MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / addMetrics

Function addMetrics

compose/compose.go:475–532  ·  view source on GitHub ↗
(cfg *composeConfig)

Source from the content-addressed store, hash-verified

473}
474
475func addMetrics(cfg *composeConfig) {
476 cfg.Volumes["prometheus-volume"] = stringMap{}
477 cfg.Volumes["grafana-volume"] = stringMap{}
478
479 cfg.Services["node-exporter"] = service{
480 Image: "quay.io/prometheus/node-exporter:v1.0.1",
481 ContainerName: containerName("node-exporter"),
482 Pid: "host",
483 WorkingDir: "/working/jaeger",
484 Volumes: []volume{{
485 Type: "bind",
486 Source: "/",
487 Target: "/host",
488 ReadOnly: true,
489 }},
490 }
491
492 cfg.Services["prometheus"] = service{
493 Image: "prom/prometheus:v2.20.1",
494 ContainerName: containerName("prometheus"),
495 Hostname: "prometheus",
496 Ports: []string{
497 toPort(9090),
498 },
499 Volumes: []volume{
500 {
501 Type: "volume",
502 Source: "prometheus-volume",
503 Target: "/prometheus",
504 },
505 {
506 Type: "bind",
507 Source: "$GOPATH/src/github.com/dgraph-io/dgraph/compose/prometheus.yml",
508 Target: "/etc/prometheus/prometheus.yml",
509 ReadOnly: true,
510 },
511 },
512 }
513
514 cfg.Services["grafana"] = service{
515 Image: "grafana/grafana:7.1.2",
516 ContainerName: containerName("grafana"),
517 Hostname: "grafana",
518 Ports: []string{
519 toPort(3000),
520 },
521 Environment: []string{
522 // Skip login
523 "GF_AUTH_ANONYMOUS_ENABLED=true",
524 "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin",
525 },
526 Volumes: []volume{{
527 Type: "volume",
528 Source: "grafana-volume",
529 Target: "/var/lib/grafana",
530 }},
531 }
532}

Callers 1

mainFunction · 0.85

Calls 2

containerNameFunction · 0.85
toPortFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…