Skip to content

Add metric metadata to message (#102)#112

Open
arunsudhakar wants to merge 4 commits into
Telefonica:masterfrom
arunsudhakar:feat/add-metric-metadata-to-message
Open

Add metric metadata to message (#102)#112
arunsudhakar wants to merge 4 commits into
Telefonica:masterfrom
arunsudhakar:feat/add-metric-metadata-to-message

Conversation

@arunsudhakar

@arunsudhakar arunsudhakar commented Mar 15, 2023

Copy link
Copy Markdown

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

Comment thread README.md

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
Copy Markdown
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.

Comment thread metadata.go
"github.com/sirupsen/logrus"
)

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

@johnseekins johnseekins Aug 6, 2023

Copy link
Copy Markdown
Contributor

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?

Comment thread README.md
## 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
Copy Markdown
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