Closed jonathan-anyword closed 9 months ago
Found solution:
collector = PrometheusExporter::Server::Collector.new
require 'graphql/tracing/prometheus_tracing/graphql_collector'
collector.register_collector(GraphQL::Tracing::PrometheusTracing::GraphQLCollector.new)
server = PrometheusExporter::Server::WebServer.new bind: '0.0.0.0',
port: PROMETHEUS_METRICS_PORT,
collector: collector
server.start
Hi, In graphql-ruby prometheus implementation the docs ask to run the exporter with the command:
bundle exec prometheus_exporter -a lib/graphql_collector.rb
This server exporter have the option to run as rails initializer with:
PrometheusExporter::Server::WebServer.new
Is it possible to run the server from the main process flow with the graphql_collector without the need of the
bundle exec
command?