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

[simple prometheus receiver]Support customized job name in configuration #31502

Open
chenlujjj opened this issue Feb 29, 2024 · 7 comments · May be fixed by #34408
Open

[simple prometheus receiver]Support customized job name in configuration #31502

chenlujjj opened this issue Feb 29, 2024 · 7 comments · May be fixed by #34408
Assignees
Labels

Comments

@chenlujjj
Copy link
Contributor

Component(s)

receiver/simpleprometheus

Is your feature request related to a problem? Please describe.

Hi team, we use the simple prometheus receiver within the receiver creator to scrape metrics from k8s pods with specific annotations, the config is like:

receiver_creator/application:
      receivers:
        prometheus_simple/app_pods:
          rule: type == "port" && pod.annotations["prometheus.io/scrape"] == "true" && ( string(port) == pod.annotations["prometheus.io/port"] || name == pod.annotations["prometheus.io/port"] )
          config:
            endpoint: '`endpoint`'
            metrics_path: '`"prometheus.io/path" in pod.annotations ? pod.annotations["prometheus.io/path"] : "/metrics"`'
            collection_interval: '`"prometheus.io/collection_interval" in pod.annotations ? pod.annotations["prometheus.io/collection_interval"] : "30s"`'

it works good, but a small problem is that the simple prometheus receiver uses the prometheus_simple/$endpoint as the job name which would be transformed to service.name label in the metric.

It will be great if we can customize the job name here.

Describe the solution you'd like

Add a job name setting in the configuration. The setting is optional.

Describe alternatives you've considered

No response

Additional context

No response

@chenlujjj chenlujjj added enhancement New feature or request needs triage New item requiring triage labels Feb 29, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@fatsheep9146
Copy link
Contributor

@chenlujjj Thanks for your advise, I will take a look at this.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@freshyjmp
Copy link

Also running into this. Would appreciate some other way to not have job_name always become service.name. For some applications deployed via operator they have multiple metric paths, but all metrics should be rolled up under one service.name

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Sep 23, 2024
@jmichalek132
Copy link
Contributor

not stale

@chenlujjj
Copy link
Contributor Author

Hi @fatsheep9146 , have you got time to review the PR ?

@github-actions github-actions bot removed the Stale label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants