Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric metadata to message (#102) #112

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

arunsudhakar
Copy link

@arunsudhakar arunsudhakar commented Mar 15, 2023

This PR allows the inclusion of the Metric metadata into the topic and resolves #102 . This is controlled by 2 ENV variables

  • PROM_METADATA_ENDPOINT: defines prometheus metric metadata endpoint , not set by default and hence metadata wont be included.
  • INLCUDED_METADATA: specifies which attributes to be exported. The attributes should be comma separated. Permitted values are type, help and unit. Only type is included by default

@@ -38,6 +42,8 @@ There is a docker image `telefonica/prometheus-kafka-adapter:1.8.0` [available o

Prometheus-kafka-adapter listens for metrics coming from Prometheus and sends them to Kafka. This behaviour can be configured with the following environment variables:

- `PROM_METADATA_ENDPOINT`: defines prometheus metric metadata endpoint , not set by default and hence metadata wont be included.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we just made this a boolean instead (e.g. ENABLE_PROM_METADATA)? Requiring the endpoint may be a bit confusing.

"github.com/sirupsen/logrus"
)

func GetAllMetricMetadata(promMetaDataEndPoint string, metricsList map[string]MetricMetadata) {
Copy link
Contributor

@johnseekins johnseekins Aug 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels pretty hacky. Is there any way we could instead interface with the metrics object in memory instead of making an internal call?

@@ -6,21 +6,25 @@ Prometheus-kafka-adapter is a service which receives [Prometheus](https://github

## output

It is able to write JSON or Avro-JSON messages in a kafka topic, depending on the `SERIALIZATION_FORMAT` configuration variable.
It is able to write JSON or Avro-JSON messages in a kafka topic, depending on the `SERIALIZATION_FORMAT` configuration variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up extra spaces, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus Metric type missing in the serialized JSON to Kafka
2 participants