Skip to content

Link to repo that use TelemetryMetricsPrometheus #42

@ebengt

Description

@ebengt

Greetings,

I have read Hex documentation for TelemetryMetricsPrometheus, Telemetry.Metrics, OpentelemetryPhoenix
It probably should be enough, but I fail to get content from localhost:9568/metrics. I get a 200 Response, but 0 content-length.

A link to any repo using TelemetryMetricsPrometheus (and Phoenix, if possible), would be much appreciated.

From my application.ex

  def start(_type, _args) do
    :opentelemetry_cowboy.setup()
    OpentelemetryPhoenix.setup(adapter: :cowboy2)
    OpentelemetryEcto.setup([:excdf, :repo])

    metrics =  [
    Telemetry.Metrics.last_value("vm.memory.total", unit: :byte),
    Telemetry.Metrics.counter("http.request.count", unit: :byte),
    Telemetry.Metrics.sum("http.request.payload_size", unit: :byte)
    ]

    children = [
      # Start the Telemetry supervisor
      ExcdfWeb.Telemetry,
      {Phoenix.PubSub, name: ExcdfWeb.PubSub},
      {TelemetryMetricsPrometheus, [metrics: metrics]},
      # Start the Endpoint (http/https)
      ExcdfWeb.Endpoint
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: ExcdfWeb.Supervisor]
    Supervisor.start_link(children, opts)
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions