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

Is there a way Prometheus can pass cookie in each scrape request to Spring Boot #4748

Closed
Aracki opened this Issue Oct 16, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@Aracki
Copy link

Aracki commented Oct 16, 2018

I'm trying to scrape Spring Boot service running in production. We are using micrometer with prometheus registry:

compile 'io.micrometer:micrometer-spring-legacy:1.0.6'
compile 'io.micrometer:micrometer-registry-prometheus:1.0.6'

Environment

  • Prometheus version:

    I am running Prometheus in docker. Image: prom/prometheus:v2.4.2

  • Prometheus configuration file:

global:
  scrape_interval:     5s # Set the scrape interval to every 5 seconds.
  evaluation_interval: 5s # Evaluate rules every 5 seconds.
scrape_configs:
  - job_name: 'global'
    metrics_path: '/management/prometheus'
    static_configs:
      - targets: ['global:8081']
  • Logs:
server returned HTTP status 403

What is the proper way to pass through Spring Security? Is there a way for a Prometheus to send cookie with session id? What is the best practices here?

I have asked this on SO too.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 16, 2018

Prometheus supports basic HTTP, X509 client and bearer token authentications.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Oct 16, 2018

Also to make your question, and all replies, easier to find, we suggest you move this over to our user mailing list, which you can also search. If you prefer more interactive help, join or our IRC channel, #prometheus on irc.freenode.net. Please be aware that our IRC channel has no logs, is not searchable, and that people might not answer quickly if they are busy or asleep. If in doubt, you should choose the mailing list.

Once your questions have been answered, please add a short line pointing to relevant replies in case anyone stumbles here via a search engine in the future.

@Aracki

This comment has been minimized.

Copy link
Author

Aracki commented Oct 17, 2018

After further research I have found out that there's no current way to set cookies via the scrape config.

Prometheus supports only HTTP Authorization headers like Basic and Bearer tokens.

@Aracki Aracki closed this Oct 17, 2018

@lock lock bot locked and limited conversation to collaborators Apr 15, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.