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

add proxyPath config for graphite web endpoint #3893

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/documentation/sitespeed.io/configuration/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Graphite
--graphite.auth The Graphite user and password used for authentication. Format: user:password
--graphite.httpPort The Graphite port used to access the user interface and send annotations event [default: 8080]
--graphite.webHost The graphite-web host. If not specified graphite.host will be used.
--graphite.proxyPath The added path to graphite-web api when behind a proxy. [default: ""]
--graphite.namespace The namespace key added to all captured metrics. [default: "sitespeed_io.default"]
--graphite.includeQueryParams Whether to include query parameters from the URL in the Graphite keys or not [boolean] [default: false]
--graphite.arrayTags Send the tags as Array or a String. In Graphite 1.0 the tags is a array. Before a String [boolean] [default: true]
Expand Down
5 changes: 5 additions & 0 deletions lib/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,11 @@ export async function parseCommandLine() {
'The graphite-web host. If not specified graphite.host will be used.',
group: 'Graphite'
})
.option('graphite.proxyPath', {
describe: 'The added path to graphite-web when behind a proxy.',
default: '',
group: 'Graphite'
})
.option('graphite.namespace', {
default: 'sitespeed_io.default',
describe: 'The namespace key added to all captured metrics.',
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/graphite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default class GraphitePlugin extends SitespeedioPlugin {
this.receivedTypesThatFireAnnotations = {};
this.make = context.messageMaker('graphite').make;
this.sendAnnotation = options_.sendAnnotation;
this.proxyPath = options_.proxyPath;
this.alias = {};
this.wptExtras = {};
this.usingBrowsertime = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/graphite/send-annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function send(
const postOptions = {
hostname: options.graphite.webHost || options.graphite.host,
port: options.graphite.httpPort || 8080,
path: '/events/',
path: options.graphite.proxyPath + '/events/',
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down