# apollo-prometheus-plugin **Repository Path**: mirrors_tomasAlabes/apollo-prometheus-plugin ## Basic Information - **Project Name**: apollo-prometheus-plugin - **Description**: An Apollo Plugin for Prometheus metrics - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2025-09-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Apollo Prometheus Plugin Fork with support for latest `prom-client` versions. ## Install `npm install @talabes/apollo-prometheus-plugin` `yarn add @talabes/apollo-prometheus-plugin` ## Usage ```typescript import { ApolloServer, gql } from 'apollo-server-express'; import { prometheusPlugin } from 'apollo-prometheus-plugin'; import { Registry } from 'prom-client'; import { prometheusPlugin } from '@talabes/apollo-prometheus-plugin'; const register = new Registry(); const app = express(); app.get('/metrics', (_, res) => res.send(register.metrics())); const server = new ApolloServer({ typeDefs, resolvers, plugins: [prometheusPlugin(register, { enableNodeMetrics: true })], }); server.applyMiddleware({ app, path: '/' }); app.listen({ port: 8080 }, () => { console.log('Listening'); }); ``` ## Available metrics and labels | metric | type | labels | | -------------------- | --------- | ------------------------------------- | | errors_encountered | Counter | operationName
operation
error | | requests_resolved | Counter | operationName
operation | | attributes_requested | Counter | fieldName
parentType | | resolver_time | Histogram | fieldName
parentType
returnType | | total_request_time | Histogram | operationName
operation |