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

Disabled metric agent features do not remove the agent #336

Open a-thaler opened 1 year ago

a-thaler commented 1 year ago

Description I have a MetricPipeline defined like that:

apiVersion: telemetry.kyma-project.io/v1alpha1
kind: MetricPipeline
metadata:
  name: icke
spec:
  input:
    application:
      runtime:
        enabled: true
  output:
    ...

which results in a agent and gateway deployment and all is working as expected. When disabling the runtime at a later time:

  input:
    application:
      runtime:
        enabled: false

the agent will not get deleted and continues collecting the runtime data. Indeed, the gateway is filtering out the data and the actual result is as expected. However, removing the agent will save money. Also, the agent uses the last applied config and will send runtime data, but will not scrape istio metrics for example. That is inconsistent.

Expected result

The agent gets deleted and stops collecting runtime data.

Actual result The agent stays (as well as the config) in an unattended mode (not being reconciled anymore) and it continues to collect data

Implementation Hints The OTel collector's resource management is in the internal/resources/otelcollector pkg. Right now, it has ApplyAgentResources and ApplyGatewayResources functions available. To add DeleteAgentResources, we need to separate making different kinds of resources (RBAC, Services, Deployment/DaemonSet, etc.) from what we do with them (like creating or updating). This change will make it easier to add the option to delete without repeating the code.

Steps to reproduce

Troubleshooting

kyma-bot commented 10 months ago

This issue or PR has been automatically marked as stale due to the lack of recent activity. Thank you for your contributions.

This bot triages issues and PRs according to the following rules:

You can:

If you think that I work incorrectly, kindly raise an issue with the problem.

/lifecycle stale

github-actions[bot] commented 8 months 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.

github-actions[bot] commented 5 months 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.

github-actions[bot] commented 3 months 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.

github-actions[bot] commented 1 month 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.