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

Create a PullController for metrics #796

Closed
dyladan opened this issue Feb 19, 2020 · 13 comments
Closed

Create a PullController for metrics #796

dyladan opened this issue Feb 19, 2020 · 13 comments
Labels
feature-request up-for-grabs Good for taking. Extra help will be provided by maintainers

Comments

@dyladan
Copy link
Member

dyladan commented Feb 19, 2020

Currently we only implement the PushController, but we would also like a PullController for cases like prometheus where the exporter is called by the backend.

@dyladan dyladan added this to the Beta milestone Feb 19, 2020
@dyladan dyladan mentioned this issue Feb 20, 2020
46 tasks
@dyladan dyladan added the up-for-grabs Good for taking. Extra help will be provided by maintainers label Feb 26, 2020
@Bhargavamacha
Copy link

I would like to take this issue up if that's fine

@vmarchaud vmarchaud removed the up-for-grabs Good for taking. Extra help will be provided by maintainers label Feb 28, 2020
@vmarchaud
Copy link
Member

@Bhargavamacha It is ! Don't hesitate to ping us on gitter or here if you have any questions or need help :)

@Bhargavamacha
Copy link

Sure!

@Bhargavamacha
Copy link

Bhargavamacha commented Mar 2, 2020

I am trying to understand how exactly the PullController should work and this is how I think the flow goes:
The PushController controls the flow of metrics to the exporter. Now, these metrics will be polled by Prometheus and PullController should control the flow to Prometheus.
Prometheus has a scrape_interval that lets it collect metrics at certain time intervals. My question is, what role does PullController really play? I found this to be a good explanation, but I am not really sure how it can exactly be implemented.

@dyladan
Copy link
Member Author

dyladan commented Mar 10, 2020

@Bhargavamacha any update here?

@Bhargavamacha
Copy link

I am still trying to understand how it should be implemented, but I couldn't really solve the question in the previous comment. Any help would be appreciated.

@dyladan
Copy link
Member Author

dyladan commented Mar 11, 2020

Controllers are constructed with a meter and an exporter. What I would do is add an optional function to the exporter interface called registerPullController or similar. When a Meter is constructed, if this function exists then a PullController is created, otherwise a PushController is created. registerPullController would be a function that receives a PullController, and calls its public collect method when it wants metrics to be exported.

@dyladan
Copy link
Member Author

dyladan commented Mar 11, 2020

@Bhargavamacha does that make sense to you?

@Bhargavamacha
Copy link

Yup. Thanks!

@dyladan dyladan modified the milestones: Beta, After Beta Release Mar 18, 2020
@dyladan
Copy link
Member Author

dyladan commented Apr 29, 2020

@Bhargavamacha any update here?

@dyladan dyladan added the up-for-grabs Good for taking. Extra help will be provided by maintainers label Apr 30, 2020
@legendecas
Copy link
Member

legendecas commented May 5, 2020

With #1017, I believe PullController can be left to users (who do the actual pulling) to implement it since it will be very straightforward to do it. There is no meaningful reason to add a default PullController since the actual pulling strategies vary across use cases.

@dyladan
Copy link
Member Author

dyladan commented May 5, 2020

The reason to add a pullcontroller is that prometheus polls an endpoint, and it would be ideal for that endpoint to be updated on each poll rather than on a schedule

@dyladan
Copy link
Member Author

dyladan commented Jun 1, 2022

Previous SDK. No longer applies

@dyladan dyladan closed this as completed Jun 1, 2022
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
…ped handler (open-telemetry#796)

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request up-for-grabs Good for taking. Extra help will be provided by maintainers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants