ardatan / graphql-mesh

🕸️ GraphQL Federation Framework for any API services such as REST, OpenAPI, Swagger, SOAP, gRPC and more...
https://the-guild.dev/graphql/mesh
MIT License
3.29k stars 344 forks source link

How to run Prometheus with mesh start without giving an error? #6545

Closed jaksonlima closed 6 months ago

jaksonlima commented 9 months ago

🕸️ Mesh - Worker 4 💥 Error: A metric with the name graphql_mesh_fetch_duration has already been registered.

configuração

# ...
serve:
  hostname: 0.0.0.0
  playground: true
  fork: 2
# cors:
#   origin: http://localhost:4001

# ...
sources:
  - name: API-V1
    handler:
      graphql:
        endpoint: ${API_V1:http://localhost:3004/graphql}
  - name: API-V2
    handler:
      graphql:
        endpoint: ${API_V2:http://localhost:3005/graphql}

plugins:
  - prometheus:
      skipIntrospection: true
      requestCount: true
      requestSummary: true
      parse: true
      validate: true
      contextBuilding: true
      execute: true
      errors: true
      delegation: true
      fetch: true
      fetchRequestHeaders: true
      fetchResponseHeaders: true
      http: gateway
      httpRequestHeaders: true
      httpResponseHeaders: true
      deprecatedFields: true
      endpoint: /metrics
cgpoh commented 8 months ago

I get the same issue. My dependencies are as follows:

"@graphql-mesh/plugin-prometheus":` "^0.98.2",
"prom-client": "^15.1.0"