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

Spiky graphs and local blocks config #75

Merged
merged 1 commit into from
Feb 23, 2024
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
20 changes: 19 additions & 1 deletion source/mythical-beasts-requester/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,29 @@ const makeRequest = async (tracingObj, sendMessage, logEntry) => {
requestSpan.end();
});

// The following awful code creates spikes in the request rate which makes for more interesting graphs
// Joe Elliott did not write this. Do not check the blame.
counter++;
if (counter >= 3000) {
counter = 0;
}

var nextReqIn;
if (counter < 2000) {
// Choose low values in the first minute of every 5-minute interval
nextReqIn = Math.floor(Math.random() * 50);
} else {
// Choose high values for the next 4 minutes
nextReqIn = Math.floor(Math.random() * 1000) + 100;
}

// Sometime in the next two seconds, but larger than 100ms
const nextReqIn = (Math.random() * 1000) + 100;
//const nextReqIn = (Math.random() * 1000) + 100;
setTimeout(() => makeRequest(tracingObj, sendMessage, logEntry), nextReqIn);
};

let counter = 0;

(async () => {
const tracingObj = await tracingUtils();
const { sendMessage } = await queueUtils(tracingObj);
Expand Down
3 changes: 3 additions & 0 deletions tempo/tempo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ storage:
metrics_generator:
# Specifies which processors to use.
processor:
# keep all spans in the local blocks. this will allow for traceql metrics using structural queries
local_blocks:
filter_server_spans: false
# Span metrics create metrics based on span type, duration, name and service.
span_metrics:
# Configure extra dimensions to add as metric labels.
Expand Down