Skip to content

Comments

chore: Add optional prometheus metrics#144

Closed
akandic47 wants to merge 3 commits intomainfrom
chore/add-prometheus-metrics
Closed

chore: Add optional prometheus metrics#144
akandic47 wants to merge 3 commits intomainfrom
chore/add-prometheus-metrics

Conversation

@akandic47
Copy link

Description

Related Issue Or Context

Closes: #

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@github-actions
Copy link

Go Test coverage is 53.7 %\ ✨ ✨ ✨

@github-actions
Copy link

Go Test coverage is 53.7 %\ ✨ ✨ ✨

Copy link
Member

@mpetrunic mpetrunic left a comment

Choose a reason for hiding this comment

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

Isn't the whole point of opentelemetry that you can pipe it into prometheus without changing the code?

meterOpts = append(meterOpts, sdkmetric.WithReader(promExporter))
}

mp, err := observability.InitMetricProvider(context.Background(), configuration.RelayerConfig.OpenTelemetryCollectorURL, meterOpts...)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mp, err := observability.InitMetricProvider(context.Background(), configuration.RelayerConfig.OpenTelemetryCollectorURL, meterOpts...)
mp, err := observability.InitMetricProvider(ctx, configuration.RelayerConfig.OpenTelemetryCollectorURL, meterOpts...)


mp, err := observability.InitMetricProvider(context.Background(), configuration.RelayerConfig.OpenTelemetryCollectorURL)
var meterOpts []sdkmetric.Option
if configuration.RelayerConfig.PrometheusEnabled {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we even need the option.
There is really no reason to turn it off.

Copy link
Author

Choose a reason for hiding this comment

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

You mean to turn off prometheus endpoint?

@mpetrun5
Copy link
Collaborator

Isn't the whole point of opentelemetry that you can pipe it into prometheus without changing the code?

It is if you deploy the collector.
It seems @akandic47 doesn't want to.

CoinmarketcapConfig CoinmarketcapConfig
SolverConfig SolverConfig
ApiAddr string
PrometheusEnabled bool
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is an OpentelemetryCollectorURL variable which we are not using.
This doesn't make sense from the standpoint that it will still try to push to the collector, but printout logs that it fails (that is what currently happens).

@akandic47
Copy link
Author

Isn't the whole point of opentelemetry that you can pipe it into prometheus without changing the code?

It is if you deploy the collector. It seems @akandic47 doesn't want to.

Yeah I am trying to avoid running more infra stuff only because of this. All other metrics are being scraped by prometheus directly

@github-actions
Copy link

Go Test coverage is 53.7 %\ ✨ ✨ ✨

@mpetrun5
Copy link
Collaborator

Closing as Prometheus exposes collector directly

@mpetrun5 mpetrun5 closed this Feb 20, 2026
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.

3 participants