Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kyma-project/telemetry-manager into…
Browse files Browse the repository at this point in the history
… remove-legacy-status-conditions
  • Loading branch information
skhalash committed Jun 26, 2024
2 parents aacdf34 + 0a28cde commit 1df8224
Show file tree
Hide file tree
Showing 29 changed files with 643 additions and 430 deletions.
12 changes: 6 additions & 6 deletions config/busola/logpipeline_busola_extension_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data:
highlights:
positive:
- 'false'
negative:
critical:
- 'true'
body:
- source: status.conditions
Expand All @@ -37,9 +37,9 @@ data:
name: Status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
- source: reason
name: Reason
Expand Down Expand Up @@ -431,7 +431,7 @@ data:
highlights:
positive:
- 'false'
negative:
critical:
- 'true'
- name: Status
source: status.conditions
Expand All @@ -444,7 +444,7 @@ data:
source: status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
8 changes: 4 additions & 4 deletions config/busola/metricpipeline_busola_extension_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ data:
name: Status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
- source: reason
name: Reason
Expand Down Expand Up @@ -547,7 +547,7 @@ data:
source: status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
4 changes: 2 additions & 2 deletions config/busola/telemetry_busola_extension_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ data:
name: Status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
- source: reason
name: Reason
Expand Down
8 changes: 4 additions & 4 deletions config/busola/tracepipeline_busola_extension_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ data:
name: Status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
- source: reason
name: Reason
Expand Down Expand Up @@ -379,7 +379,7 @@ data:
source: status
widget: Badge
highlights:
success:
positive:
- 'True'
error:
critical:
- 'False'
12 changes: 7 additions & 5 deletions docs/contributor/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ Each test scenario has its own test scripts responsible for preparing the test s
| 3.0.7 (new metrics) | 4036 | 7173 | 31689 | 825,852 | 0.1,0.1 | 2481 | 1852 | 104689 | 747,395 | 0.1,0 | 1520 | 484 | 37907 | 561,731 | 0.1,0.1 | 807 | 58 | 94365 | 544,211 | 0,0 |
| 3.0.7 (new) | 9514 | 30273 | 30263 | 105, 113 | 1, 1 | 9027 | 23850 | 1521511 | 186, 552 | 1, 0.7 | 7285 | 8357 | 1891569 | 662, 668 | 0.8, 0.8 | 5602 | 2619 | 5249308 | 680, 713 | 0.5, 0.5 |


</div>

## Self Monitor
Expand Down Expand Up @@ -352,11 +353,12 @@ Configured memory, CPU limits, and storage are based on this base value and will

<div class="table-wrapper" markdown="block">

| Version/Test | Default | | | | |
|-------------:|:------------------:|:--------------------:|:-----------------------------:|:--------------------:|:-------------:|
| | Scrape Samples/sec | Total Series Created | Head Chunk Storage Size/bytes | Pod Memory Usage(MB) | Pod CPU Usage |
| 2.45.5 | 15.4 | 157 | 131072 | 62 | 0 |
| 2.45.5(new) | 15.4 | 239 | 131072 | 42 | 0 |
| Version/Test |Default (ci-self-monitor)| | | | |
|-------------:|:------------------:|:--------------------:|:--------------------------------:|:--------------------:|:-------------:|
| | Scrape Samples/sec | Total Series Created | Head Chunk Storage Size in bytes | Pod Memory Usage(MB) | Pod CPU Usage |
| 2.45.5 | 15.4 | 157 | 131072 | 62 | 0 |
| 2.45.5(new) | 15.4 | 239 | 131072 | 42 | 0 |
| 2.53.0 | 20.4 | 210 | 0 | 36 | 0 |


</div>
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.54.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/pdata v1.9.0
go.opentelemetry.io/collector/pdata v1.10.0
go.uber.org/zap v1.27.0
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opentelemetry.io/collector/pdata v1.9.0 h1:qyXe3HEVYYxerIYu0rzgo1Tx2d1Zs6iF+TCckbHLFOw=
go.opentelemetry.io/collector/pdata v1.9.0/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w=
go.opentelemetry.io/collector/pdata v1.10.0 h1:oLyPLGvPTQrcRT64ZVruwvmH/u3SHTfNo01pteS4WOE=
go.opentelemetry.io/collector/pdata v1.10.0/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down
6 changes: 3 additions & 3 deletions hack/load-tests/run-load-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ function get_result_and_cleanup_fluentbit() {
# shellcheck disable=SC2112
function get_result_and_cleanup_selfmonitor() {
# ingestion rate per second for scrape samples https://valyala.medium.com/prometheus-storage-technical-terms-for-humans-4ab4de6c3d48
SCRAPESAMPLES=$(curl -fs --data-urlencode 'query=sum_over_time(scrape_samples_scraped{service="telemetry-self-monitor-metrics"}[20m]) / 1200' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')
SCRAPESAMPLES=$(curl -fs --data-urlencode 'query=round(sum(sum_over_time(scrape_samples_scraped{service="telemetry-self-monitor-metrics"}[20m]) / 1200))' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

SERIESCREATED=$(curl -fs --data-urlencode 'query=max(prometheus_tsdb_head_series{service="telemetry-self-monitor-metrics"})' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')
SERIESCREATED=$(curl -fs --data-urlencode 'query=round(sum(max_over_time(prometheus_tsdb_head_series{service="telemetry-self-monitor-metrics"}[20m])))' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

HEADSTORAGESIZE=$(curl -fs --data-urlencode 'query=max(prometheus_tsdb_head_chunks_storage_size_bytes{service="telemetry-self-monitor-metrics"})' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')
HEADSTORAGESIZE=$(curl -fs --data-urlencode 'query=round(sum(max_over_time(prometheus_tsdb_head_chunks_storage_size_bytes{service="telemetry-self-monitor-metrics"}[20m])))' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

MEMORY=$(curl -fs --data-urlencode 'query=round(sum(avg_over_time(container_memory_working_set_bytes{namespace="kyma-system", container="self-monitor"}[20m]) * on(namespace,pod) group_left(workload) avg_over_time(namespace_workload_pod:kube_pod_owner:relabel{namespace="kyma-system", workload="telemetry-self-monitor"}[20m])) by (pod) / 1024 / 1024)' localhost:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

Expand Down
6 changes: 1 addition & 5 deletions internal/reconciler/logpipeline/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,7 @@ func (r *Reconciler) reconcileFluentBit(ctx context.Context, pipeline *telemetry
return fmt.Errorf("failed to reconcile fluent bit metrics service: %w", err)
}

includeSections := true
if len(pipelines) == 0 {
includeSections = false
}
cm := fluentbit.MakeConfigMap(r.config.DaemonSet, includeSections)
cm := fluentbit.MakeConfigMap(r.config.DaemonSet)
if err := k8sutils.CreateOrUpdateConfigMap(ctx, ownerRefSetter, cm); err != nil {
return fmt.Errorf("failed to reconcile fluent bit configmap: %w", err)
}
Expand Down
68 changes: 68 additions & 0 deletions internal/reconciler/metricpipeline/mocks/agent_applier_deleter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 21 additions & 19 deletions internal/reconciler/metricpipeline/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ type GatewayConfigBuilder interface {
Build(ctx context.Context, pipelines []telemetryv1alpha1.MetricPipeline) (*gateway.Config, otlpexporter.EnvVars, error)
}

type AgentResourcesHandler interface {
//go:generate mockery --name AgentApplierDeleter --filename agent_applier_deleter.go
type AgentApplierDeleter interface {
ApplyResources(ctx context.Context, c client.Client, opts otelcollector.AgentApplyOptions) error
DeleteResources(ctx context.Context, c client.Client) error
}

type GatewayResourcesHandler interface {
//go:generate mockery --name GatewayApplierDeleter --filename gateway_applier_deleter.go
type GatewayApplierDeleter interface {
ApplyResources(ctx context.Context, c client.Client, opts otelcollector.GatewayApplyOptions) error
DeleteResources(ctx context.Context, c client.Client, isIstioActive bool) error
}
Expand Down Expand Up @@ -97,17 +99,17 @@ type Reconciler struct {
client.Client
config Config

agentConfigBuilder AgentConfigBuilder
gatewayConfigBuilder GatewayConfigBuilder
agentResourcesHandler AgentResourcesHandler
gatewayResourcesHandler GatewayResourcesHandler
pipelineLock PipelineLock
gatewayProber DeploymentProber
agentProber DaemonSetProber
flowHealthProber FlowHealthProber
tlsCertValidator TLSCertValidator
overridesHandler OverridesHandler
istioStatusChecker IstioStatusChecker
agentConfigBuilder AgentConfigBuilder
gatewayConfigBuilder GatewayConfigBuilder
agentApplierDeleter AgentApplierDeleter
gatewayApplierDeleter GatewayApplierDeleter
pipelineLock PipelineLock
gatewayProber DeploymentProber
agentProber DaemonSetProber
flowHealthProber FlowHealthProber
tlsCertValidator TLSCertValidator
overridesHandler OverridesHandler
istioStatusChecker IstioStatusChecker
}

func NewReconciler(
Expand All @@ -132,10 +134,10 @@ func NewReconciler(
},
},
},
gatewayResourcesHandler: &otelcollector.GatewayResourcesHandler{
gatewayApplierDeleter: &otelcollector.GatewayApplierDeleter{
Config: config.Gateway,
},
agentResourcesHandler: &otelcollector.AgentResourcesHandler{
agentApplierDeleter: &otelcollector.AgentApplierDeleter{
Config: config.Agent,
},
pipelineLock: resourcelock.New(client, types.NamespacedName{
Expand Down Expand Up @@ -203,10 +205,10 @@ func (r *Reconciler) doReconcile(ctx context.Context, pipeline *telemetryv1alpha

if len(reconcilablePipelines) == 0 {
logf.FromContext(ctx).V(1).Info("cleaning up metric pipeline resources: all metric pipelines are non-reconcilable")
if err = r.gatewayResourcesHandler.DeleteResources(ctx, r.Client, r.istioStatusChecker.IsIstioActive(ctx)); err != nil {
if err = r.gatewayApplierDeleter.DeleteResources(ctx, r.Client, r.istioStatusChecker.IsIstioActive(ctx)); err != nil {
return fmt.Errorf("failed to delete gateway resources: %w", err)
}
if err = r.agentResourcesHandler.DeleteResources(ctx, r.Client); err != nil {
if err = r.agentApplierDeleter.DeleteResources(ctx, r.Client); err != nil {
return fmt.Errorf("failed to delete agent resources: %w", err)
}
return nil
Expand Down Expand Up @@ -308,7 +310,7 @@ func (r *Reconciler) reconcileMetricGateway(ctx context.Context, pipeline *telem
ResourceRequirementsMultiplier: len(allPipelines),
}

if err := r.gatewayResourcesHandler.ApplyResources(
if err := r.gatewayApplierDeleter.ApplyResources(
ctx,
k8sutils.NewOwnerReferenceSetter(r.Client, pipeline),
opts,
Expand Down Expand Up @@ -337,7 +339,7 @@ func (r *Reconciler) reconcileMetricAgents(ctx context.Context, pipeline *teleme
allowedPorts = append(allowedPorts, ports.IstioEnvoy)
}

if err := r.agentResourcesHandler.ApplyResources(
if err := r.agentApplierDeleter.ApplyResources(
ctx,
k8sutils.NewOwnerReferenceSetter(r.Client, pipeline),
otelcollector.AgentApplyOptions{
Expand Down
Loading

0 comments on commit 1df8224

Please sign in to comment.