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

documentation miss: Docker label PROMETHEUS_EXPORTER_PORT should be defined in ECS Task definition #68

Closed
muravjov opened this issue Jun 12, 2021 · 5 comments

Comments

@muravjov
Copy link
Contributor

First of all: thanks, it works.

But the documentation lacks information how to set docker label(s).
I tried to to set up PROMETHEUS_EXPORTER_PORT in Dockerfile like

LABEL "PROMETHEUS_EXPORTER_PORT"="5000"

but still failed to write non-empty ecs_file_sd.yml . The log still featured

2021/06/12 04:00:51 Writing 0 discovered exporters to ecs_file_sd.yml

After poking with ECS services I managed to add

"dockerLabels": {
        "PROMETHEUS_EXPORTER_PORT": "5000"
      }

to the ECS task definition JSONs and it is what really fixed the issue.

I'm somewhat new to AWS ECS service stuff and maybe propagating real docker labels can be made, but current documentation is misleading, e.g. the words

To scrape the containers add following docker labels to them:
    PROMETHEUS_EXPORTER_PORT specify the container port where prometheus scrapes (mandatory)
@chicofranchico
Copy link
Contributor

Hi, I don't see where this information is missing. If you think the documentation is lacking, just make a pull request and we can review it. Thanks!

muravjov pushed a commit to muravjov/prometheus-ecs-discovery that referenced this issue Jun 18, 2021
@muravjov
Copy link
Contributor Author

@chicofranchico done in PR #69
pls review

@chicofranchico
Copy link
Contributor

That's much clearer indeed. Thanks for that.

@gopkris2000
Copy link

@chicofranchico @muravjov
I deployed the prometheus-ecs-discovery container in one of my AWS EC2 instance. It is running fine but getting the same "Writing 0 discovered exporters to /tmp/ecs_file_sd.yml" errors.

The confusion part is here,
I tried to setup dockerLabels in my ECS task definition but showing a huge number of existing task definition in my AWS account and multiple cluster as well.
Do I need to modify each task definition with the above dockerLabels config? or create a new one and again deploy the new container "prometheus-ecs-discovery"?

Please help me.

@Rudd-O
Copy link
Contributor

Rudd-O commented Feb 2, 2023

Sorry but this is an issue tracker, not a support request forum. If it's getting no discovered exporters then there's probably a label matching issue.

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

No branches or pull requests

4 participants