Comments (5)
Using the options, I was able to get this plugin at least partially running with:
createPrometheusExporterPlugin({ metricsEndpoint: false, defaultMetrics: false })
What I'm seeing on my endpoint now contains this:
# HELP apollo_server_starting The last timestamp when Apollo Server was starting.
# TYPE apollo_server_starting gauge
apollo_server_starting{version="v2.21.0",hostname="RROSS-XPS15"} 1614355537.831
# HELP apollo_server_closing The amount timestamp when Apollo Server was closing.
# TYPE apollo_server_closing gauge
# HELP apollo_query_started The amount of received queries.
# TYPE apollo_query_started counter
# HELP apollo_query_parse_started The amount of queries for which parsing has started.
# TYPE apollo_query_parse_started counter
# HELP apollo_query_parse_failed The amount of queries for which parsing has failed.
# TYPE apollo_query_parse_failed counter
# HELP apollo_query_validation_started The amount of queries for which validation has started.
# TYPE apollo_query_validation_started counter
# HELP apollo_query_validation_failed The amount of queries for which validation has failed.
# TYPE apollo_query_validation_failed counter
# HELP apollo_query_resolved The amount of queries which could be resolved.
# TYPE apollo_query_resolved counter
# HELP apollo_query_execution_started The amount of queries for which execution has started.
# TYPE apollo_query_execution_started counter
# HELP apollo_query_execution_failed The amount of queries for which execution has failed.
# TYPE apollo_query_execution_failed counter
# HELP apollo_query_failed The amount of queries that failed.
# TYPE apollo_query_failed counter
# HELP apollo_query_duration The total duration of a query.
# TYPE apollo_query_duration histogram
# HELP apollo_query_field_resolution_duration The total duration for resolving fields.
# TYPE apollo_query_field_resolution_duration histogram
However, I'm not seeing any actual statistics being gathered when I make Apollo queries.
from apollo-prometheus-exporter.
Hello!
Yep, express
is used only for exposing the metrics. What you can do:
import { register } from 'prom-client';
const app = new koa();
const router = new koaRouter();
const prometheusExporterPlugin = createPrometheusExporterPlugin({
register, // this may not be needed but it ensures that the correct prom-client register is used
metricsEndpoint: false // this will disable the integration between the plugin and express
});
// ... continue with the usual implementation of Apollo
router.get('/metrics', async (ctx) => {
ctx.type = register.contentType; // set the correct content type from the prom-client register
ctx.body = await actualRegister.metrics(); // set the body of the response to the data exposed by prom-client
});
from apollo-prometheus-exporter.
Also, can you please post an example using StackBlitz or a GitHub repo to look over? It would help a lot.
Thanks!
from apollo-prometheus-exporter.
I'm going to close this for no activity. Please feel free to reopen it if needed.
from apollo-prometheus-exporter.
Finally had a chance to circle back on this. I does look like it is working now:
# HELP apollo_server_starting The last timestamp when Apollo Server was starting.
# TYPE apollo_server_starting gauge
apollo_server_starting{version="v2.22.2",hostname="RROSS-XPS15"} 1617279638.125
# HELP apollo_server_closing The amount timestamp when Apollo Server was closing.
# TYPE apollo_server_closing gauge
# HELP apollo_query_started The amount of received queries.
# TYPE apollo_query_started counter
apollo_query_started{operationName="IntrospectionQuery",hostname="RROSS-XPS15"} 2
apollo_query_started{hostname="RROSS-XPS15"} 9
# HELP apollo_query_parse_started The amount of queries for which parsing has started.
# TYPE apollo_query_parse_started counter
apollo_query_parse_started{operationName="IntrospectionQuery",hostname="RROSS-XPS15"} 1
apollo_query_parse_started{hostname="RROSS-XPS15"} 2
# HELP apollo_query_parse_failed The amount of queries for which parsing has failed.
# TYPE apollo_query_parse_failed counter
# HELP apollo_query_validation_started The amount of queries for which validation has started.
# TYPE apollo_query_validation_started counter
apollo_query_validation_started{operationName="IntrospectionQuery",hostname="RROSS-XPS15"} 1
apollo_query_validation_started{hostname="RROSS-XPS15"} 2
# HELP apollo_query_validation_failed The amount of queries for which validation has failed.
# TYPE apollo_query_validation_failed counter
# HELP apollo_query_resolved The amount of queries which could be resolved.
# TYPE apollo_query_resolved counter
apollo_query_resolved{operationName="IntrospectionQuery",operation="query",hostname="RROSS-XPS15"} 2
apollo_query_resolved{operation="query",hostname="RROSS-XPS15"} 9
# HELP apollo_query_execution_started The amount of queries for which execution has started.
# TYPE apollo_query_execution_started counter
apollo_query_execution_started{operationName="IntrospectionQuery",operation="query",hostname="RROSS-XPS15"} 2
apollo_query_execution_started{operation="query",hostname="RROSS-XPS15"} 9
# HELP apollo_query_execution_failed The amount of queries for which execution has failed.
# TYPE apollo_query_execution_failed counter
# HELP apollo_query_failed The amount of queries that failed.
# TYPE apollo_query_failed counter
# HELP apollo_query_duration The total duration of a query.
# TYPE apollo_query_duration histogram
apollo_query_duration_bucket{le="0.001",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 0
apollo_query_duration_bucket{le="0.005",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 0
apollo_query_duration_bucket{le="0.015",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 0
apollo_query_duration_bucket{le="0.05",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.1",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.2",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.3",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.4",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.5",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="1",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="5",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="10",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="+Inf",operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_sum{operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 0.082
apollo_query_duration_count{operationName="IntrospectionQuery",operation="query",success="true",hostname="RROSS-XPS15"} 3
apollo_query_duration_bucket{le="0.001",operation="query",success="true",hostname="RROSS-XPS15"} 8
apollo_query_duration_bucket{le="0.005",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.015",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.05",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.1",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.2",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.3",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.4",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="0.5",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="1",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="5",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="10",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_bucket{le="+Inf",operation="query",success="true",hostname="RROSS-XPS15"} 10
apollo_query_duration_sum{operation="query",success="true",hostname="RROSS-XPS15"} 0.008
apollo_query_duration_count{operation="query",success="true",hostname="RROSS-XPS15"} 10
# HELP apollo_query_field_resolution_duration The total duration for resolving fields.
# TYPE apollo_query_field_resolution_duration histogram
apollo_query_field_resolution_duration_bucket{le="0.001",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.005",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.015",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.05",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.1",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.2",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.3",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.4",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.5",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="1",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="5",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="10",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="+Inf",operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_sum{operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 0
apollo_query_field_resolution_duration_count{operation="query",fieldName="pingStudyDesignService",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 8
apollo_query_field_resolution_duration_bucket{le="0.001",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.005",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.015",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.05",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.1",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.2",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.3",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.4",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.5",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="1",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="5",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="10",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="+Inf",operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_sum{operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 0
apollo_query_field_resolution_duration_count{operation="query",fieldName="features",parentType="Query",pathLength="1",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.001",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.005",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.015",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.05",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.1",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.2",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.3",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.4",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="0.5",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="1",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="5",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="10",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_bucket{le="+Inf",operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
apollo_query_field_resolution_duration_sum{operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 0
apollo_query_field_resolution_duration_count{operation="query",fieldName="studyActivityReorderingAllowed",parentType="FeatureResponse",pathLength="2",hostname="RROSS-XPS15"} 2
from apollo-prometheus-exporter.
Related Issues (20)
- [question] how to ignore specific error? HOT 2
- apollo-server 3 support HOT 6
- Customize `durationHistogramsBuckets` HOT 3
- Optional `QUERY_DURATION` metric in failed queries HOT 3
- Possible perf_hooks memory leak detected HOT 3
- Support prom-client v14? HOT 1
- How to unexpose `/metrics` to public internet HOT 1
- didEndHook is not a function error
- Plugin metrics not being recorded/returned HOT 2
- durationHistogramBuckets doesn`t work HOT 1
- Trying use skipMetrics, but it doesn't work HOT 1
- Support for metrics in the `didResolveSource` event
- defaultLabels & hostnameLabel not functional
- Metrics on the number errors returned
- Support apolo server v4 HOT 4
- Apollo logs not being flushed
- Default metrics are not being registered in the registry passed in register option
- Support clustering mode HOT 1
- Support prom-client v15 HOT 3
- Nest.js implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-prometheus-exporter.