Add datacenter tag to entry-spans

This will add a random "datacenter" tag on the entries where
supported to improve showcasing geo capabilities.
This commit is contained in:
Cedric Ziel
2020-11-02 12:08:31 +01:00
parent a11b90275c
commit 4745f2393c
10 changed files with 201 additions and 7 deletions

View File

@@ -41,6 +41,24 @@ app.use((req, res, next) => {
next();
});
app.use((req, res, next) => {
let dcs = [
"us-east1",
"us-east2",
"us-east3",
"us-east4",
"us-central1",
"us-west1",
"us-west2",
"eu-west3",
"eu-west4"
];
let span = instana.currentSpan();
span.annotate('custom.sdk.tags.datacenter', dcs[Math.floor(Math.random() * dcs.length)]);
next();
});
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());