Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert undefined or null to object #2

Open
Bargey13 opened this issue Jun 6, 2019 · 4 comments
Open

Cannot convert undefined or null to object #2

Bargey13 opened this issue Jun 6, 2019 · 4 comments

Comments

@Bargey13
Copy link

Bargey13 commented Jun 6, 2019

I am getting this error when trying to use the plugin.


Started phase 0 (prometheus Ramp up json), duration: 60s @ 09:39:33(-0600) 2019-06-06
..  /usr/local/lib/node_modules/artillery-plugin-prometheus/node_modules/prom-client/lib/registry.js:35
		const defaultLabelNames = Object.keys(this._defaultLabels);
		                                 ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Registry.getMetricAsPrometheusString (/usr/local/lib/node_modules/artillery-plugin-prometheus/node_modules/prom-client/lib/registry.js:35:36)
    at Registry.metrics (/usr/local/lib/node_modules/artillery-plugin-prometheus/node_modules/prom-client/lib/registry.js:82:23)
    at Pushgateway.useGateway (/usr/local/lib/node_modules/artillery-plugin-prometheus/node_modules/prom-client/lib/pushgateway.js:78:27)
    at Pushgateway.pushAdd (/usr/local/lib/node_modules/artillery-plugin-prometheus/node_modules/prom-client/lib/pushgateway.js:23:14)
    at Object.pushToGateway (/usr/local/lib/node_modules/artillery-plugin-prometheus/lib/prometheus.js:156:24)
    at Object.reportResults (/usr/local/lib/node_modules/artillery-plugin-prometheus/lib/prometheus.js:137:9)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/artillery-plugin-prometheus/lib/prometheus.js:178:10)
    at EventEmitter.emit (events.js:194:15)
    at Timeout.sendStats [as _onTimeout] (/usr/local/lib/node_modules/artillery/core/lib/runner.js:305:8)
@enudler
Copy link
Owner

enudler commented Jun 6, 2019

Please provide some labels like in this example
I will fix that, btw try to check https://predator.dev it's based on artillery has this integration
{
"config": {
"plugins": {
"prometheus": {
"testName": "my_load_test_case",
"testRunId": "342-233-221",
"pushGatewayUrl": "http://localhost:9091",
"environment": "qa",
"labels": {
"performance-test"
"artillery.io"
}
}
}
}

@Bargey13
Copy link
Author

Bargey13 commented Jun 7, 2019

Yes, it looks like I was missing the labels. This will test artillery's example.
{
"config": {
"target": "https://artillery.io",
"plugins": {
"prometheus": {
"testName": "my_load_test_case ",
"testRunId": "342-233-221",
"pushGatewayUrl": "http://localhost:9091",
"environment": "qa",
"labels": {
"performance-test": null,
"artillery.io": null
}
}
},
"phases": [
{
"duration": 60,
"arrivalRate": 20
}
],
"defaults": {
"headers": {
"x-my-service-auth": "987401838271002188298567"
}
}
},
"scenarios": [
{
"flow": [
{
"get": {
"url": "/docs"
}
}
]
}
]
}

@enudler
Copy link
Owner

enudler commented Jun 7, 2019 via email

@AaronBarge
Copy link

AaronBarge commented Aug 25, 2020

Yes and no, you do need to add labels, but the labels can't have special charterers . or -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants