kyma-project / telemetry-manager

Manager for the Kyma telemetry module
https://kyma-project.io/#/telemetry-manager/user/README
Apache License 2.0
5 stars 23 forks source link

Improved metric gateway pipeline setup #1475

Open a-thaler opened 2 months ago

a-thaler commented 2 months ago

Description

With the recent features in the metric gateway, new receivers were added as well as the pipelines were split up into multiple ones being connected via connectors. The current solution has some flaws which needs to be addressed:

Proposal: Avoid duplicating definition of logic which is generic for all pipelines and restructure the pipelines in a way that we clearly map inputs to outputs. Instead of having these pipelines for two MetricPipelines called pipe1 and pipe2:

metrics/pipe1-input:
    receivers:
        - otlp
        - singleton_receiver_creator/k8s_cluster
    processors:
        - memory_limiter
    exporters:
        - routing/pipe1
metrics/pipe1-attributes-enrichment:
    receivers:
        - routing/pipe1
    processors:
        - k8sattributes
        - transform/resolve-service-name
    exporters:
        - forward/pipe1
metrics/pipe1-output:
    receivers:
        - routing/pipe1
        - forward/pipe1
    processors:
        - transform/set-instrumentation-scope-runtime
        - filter/drop-if-input-source-prometheus
        - filter/drop-if-input-source-istio
        - filter/pipe1-filter-by-namespace-runtime-input
        - filter/drop-k8s-cluster-metrics
        - resource/insert-cluster-name
        - resource/delete-skip-enrichment-attribute
        - batch
    exporters:
        - otlp/pipe1
metrics/pipe2-input:
    receivers:
        - otlp
        - singleton_receiver_creator/kymastats
        - singleton_receiver_creator/k8s_cluster
    processors:
        - memory_limiter
    exporters:
        - routing/pipe2
metrics/pipe2-attributes-enrichment:
    receivers:
        - routing/pipe2
    processors:
        - k8sattributes
        - transform/resolve-service-name
    exporters:
        - forward/pipe2
metrics/pipe2-output:
    receivers:
        - routing/pipe2
        - forward/pipe2
    processors:
        - transform/set-instrumentation-scope-runtime
        - filter/pipe2-filter-by-namespace-runtime-input
        - filter/pipe2-filter-by-namespace-prometheus-input
        - filter/drop-k8s-cluster-metrics
        - filter/drop-diagnostic-metrics-if-input-source-istio
        - transform/set-instrumentation-scope-kyma
        - resource/insert-cluster-name
        - resource/delete-skip-enrichment-attribute
        - batch
    exporters:
        - otlp/pipe2

we should have something like this:

metrics/otlp-input:
    receivers:
        - otlp
    processors:
        - memory_limiter
    exporters:
        - routing/enrichement #enrichment or (pipe1 and pipe2)
metrics/kymastats-input:
    receivers:
        - singleton_receiver_creator/kymastats
    processors:
        - memory_limiter
        - transform/set-instrumentation-scope-kyma
    exporters:
        - routing/enrichement #enrichment or (pipe1 and pipe2)
metrics/k8s_cluster-input:
    receivers:
        - singleton_receiver_creator/k8s_cluster
    processors:
        - memory_limiter
        - transform/set-instrumentation-scope-runtime
    exporters:
        - routing/enrichement #enrichment or (pipe1 and pipe2)
metrics/enrichment:
    receivers:
        - routing/enrichement
    processors:
        - k8sattributes
        - transform/resolve-service-name
        - resource/delete-skip-enrichment-attribute
    exporters:
        - forward
metrics/pipe1-output:
    receivers:
        - routing/enrichement
        - forward
    processors:
        - filter/drop-if-input-source-prometheus
        - filter/drop-if-input-source-istio
        - filter/pipe1-filter-by-namespace-runtime-input
        - filter/drop-k8s-cluster-metrics
        - resource/insert-cluster-name
        - batch
    exporters:
        - otlp/pipe1
metrics/pipe2-output:
    receivers:
        - routing/enrichement
        - forward
    processors:
        - filter/pipe2-filter-by-namespace-runtime-input
        - filter/pipe2-filter-by-namespace-prometheus-input
        - filter/drop-k8s-cluster-metrics
        - filter/drop-diagnostic-metrics-if-input-source-istio
        - resource/insert-cluster-name
        - batch
    exporters:
        - otlp/pipe2
shorim commented 2 months ago

After implementing the logic for skipping the enrichment for the Trace Gateway, we should document this feature here

github-actions[bot] commented 2 hours ago

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.