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

docker running export metrics for sidecar mode. #39

Open
kyos0109 opened this issue Nov 11, 2018 · 2 comments
Open

docker running export metrics for sidecar mode. #39

kyos0109 opened this issue Nov 11, 2018 · 2 comments

Comments

@kyos0109
Copy link

  • Varnish 6.0.1
  • prometheus_varnish_exporter 1.4.1

Hi.
Thank you for making such a great software.

Now, I'm run this software in my docker-compose and kubernetes.
I using sidecar mode running varnish container with varnish exporter container.
As I see it, maybe this solution is user friendly.

docker-compose example:

version: '2.4'
services:
  varnish:
    image: kyos0109/varnish60-distroless
    container_name: varnish
    hostname: varnish-server
    volumes:
      - ./conf/default-test.val:/default.vcl
      - varnish-data:/var/lib/varnish
    command: ["-f", "/default.vcl"]
    ports:
      - 8080:80
    networks:
      happy:
  varnish-exporter:
    image: kyos0109/prometheus-varnish-exporter
    pid: "service:varnish"
    network_mode: "service:varnish"
    ipc: "container:varnish"
    volumes:
      - varnish-data:/var/lib/varnish
    depends_on:
      - varnish
  web:
    image: nginx:alpine
    pid: "service:haproxy"
    ipc: "container:haproxy"
    network_mode: "service:haproxy"
    volumes:
      - ./conf/default.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      - haproxy
volumes:
  varnish-data:
    driver: local
networks:
  happy:
    driver: bridge

But...
I met a problem.
docker container console show message:

Could not get hold of varnishd, is it running?

I assume that, maybe varnish-export container exec varnishstats too early,
int 1 varnish container not ready running varnishd.
So, I modify some content, add flag --startup-delay in main() .

kyos0109/prometheus_varnish_exporter@25d5333

Let you refer.
Thinks.

@jonnenauha
Copy link
Owner

Try -no-exit to not exit on scrape failures. This should keep it running and ignore that varnish is not yet up.

@kyos0109
Copy link
Author

Hi,
This args is already applied using.
I just don't want to see error message. 😆

Thanks.

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

2 participants