Grafana Loki
Use the Grafana Loki sink when you want log-style LoadStrike events in Loki and projected metrics through a companion OTLP path.
Matching docs
Search across docs titles, summaries, groups, and section headings.
Use Up and Down Arrow to move through results, then press Enter to open the active page.
No indexed docs matched that search. Try a broader term or open the docs hub.
What this page helps you do
What this page helps you do
Use the Grafana Loki sink when you want log-style LoadStrike events in Loki and projected metrics through a companion OTLP path.
Who this is for
Teams exporting final run data and realtime metrics into supported observability backends.
Prerequisites
- A run result or sink destination you want to wire into the wider observability stack
By the end
A sink-specific setup path that stays tied to the same LoadStrike report model.
Use this page when
Use this page when the local report is not the only destination and you need to wire realtime or final export into a supported sink.
Visual guide
Sample Report Data Rows
Scope Scenario Result Count RPS LatencyP50Ms LatencyP80Ms LatencyP85Ms LatencyP90Ms LatencyP95Ms LatencyP99Ms
Scenario reports-demo OK 675 15.0 21.4 30.2 33.0 36.8 48.6 72.1
LatencyTable Scenario Result Count LatencyP50Ms LatencyP95Ms
LatencyTable reports-demo OK 675 21.4 48.6
LatencyTable reports-demo FAIL 12 35.9 79.2
StatusCode Result Percent
200 OK 97.48
500 FAIL 2.52
FailedStatus Scope Scenario Step StatusCode Count Percent
FailedStatus Scenario reports-demo 500 12 1.75
Reporting
Realtime reporting
Choose the built-in sink page that matches the backend your team already runs, or open Custom Reporting when you need to implement your own destination. Each tab opens a dedicated page with the settings, behavior, and lifecycle details for that reporting path.
Guide
When To Use Grafana Loki
Choose Grafana Loki when the team already indexes log-style observability events in Loki but still wants projected metrics available for dashboards and alerts.
What LoadStrike Sends
GrafanaLokiReportingSink writes reporting events to Loki and can send projected metrics through MetricsBaseUrl, MetricsEndpointPath, and MetricsHeaders to an OTLP/HTTP-compatible metrics endpoint.
Configuration Surface
Configure the sink in code or through LoadStrike:ReportingSinks:GrafanaLoki. Common options include BaseUrl, BearerToken, TenantId, StaticLabels, MetricsBaseUrl, MetricsEndpointPath, and MetricsHeaders.
Starter Assets
LoadStrike publishes a Loki datasource YAML, the shared Grafana dashboard-provider YAML, and a Loki overview dashboard JSON file.
Grafana Loki realtime reporting
Use GrafanaLokiReportingSink when you want reporting events in Loki and projected metrics through a companion OTLP/HTTP endpoint.
If you run these examples locally, add a valid runner key before execution starts. Set it with WithRunnerKey("...") or the config key LoadStrike:RunnerKey.
HTML reports also include the top-right Light/Dark theme toggle. Light is the default report theme.
Grafana Loki Sink
using LoadStrike;
var lokiSink = new GrafanaLokiReportingSink(new GrafanaLokiReportingSinkOptions
{
BaseUrl = "https://loki.example.com",
BearerToken = "loki-token",
TenantId = "platform-team",
MetricsBaseUrl = "https://otel-gateway.example.com",
MetricsEndpointPath = "/v1/metrics",
MetricsHeaders =
{
["Authorization"] = "Bearer otlp-metrics-token"
}
});
LoadStrikeRunner.RegisterScenarios(scenario)
.WithReportingSinks(lokiSink)
.WithRunnerKey("rkl_your_local_runner_key")
.Run();
package main
import loadstrike "loadstrike.com/sdk/go"
var lokiSink = loadstrike.GrafanaLokiReportingSink{
Options: loadstrike.GrafanaLokiSinkOptions{
BaseURL: "http://127.0.0.1:3100",
BearerToken: "loki-token",
TenantID: "tenant-a",
},
}
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeRunner;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeScenario;
import com.loadstrike.runtime.LoadStrikeRuntime.LoadStrikeSimulation;
import com.loadstrike.runtime.LoadStrikeSinks;
var scenario = LoadStrikeScenario.empty("orders-realtime-reporting")
.withLoadSimulations(LoadStrikeSimulation.inject(20, 1d, 120d));
var options = new LoadStrikeSinks.GrafanaLokiSinkOptions();
options.baseUrl = "https://loki.example.com";
options.bearerToken = "loki-token";
options.tenantId = "platform-team";
options.metricsBaseUrl = "https://otel-gateway.example.com";
options.metricsEndpointPath = "/v1/metrics";
options.metricsHeaders.put("Authorization", "Bearer otlp-metrics-token");
var sink = new LoadStrikeSinks.GrafanaLokiReportingSink(options);
LoadStrikeRunner.registerScenarios(scenario)
.withReportingSinks(sink)
.withRunnerKey("rkl_your_local_runner_key")
.run();
from loadstrike_sdk import GrafanaLokiReportingSink, LoadStrikeRunner, LoadStrikeScenario, LoadStrikeSimulation
scenario = (
LoadStrikeScenario.empty("orders-realtime-reporting")
.with_load_simulations(LoadStrikeSimulation.inject(20, 1, 120))
)
sink = GrafanaLokiReportingSink(
base_url="https://loki.example.com",
bearer_token="loki-token",
tenant_id="platform-team",
metrics_base_url="https://otel-gateway.example.com",
metrics_endpoint_path="/v1/metrics",
metrics_headers={
"Authorization": "Bearer otlp-metrics-token",
},
)
LoadStrikeRunner.register_scenarios(scenario) \
.with_reporting_sinks(sink) \
.with_runner_key("rkl_your_local_runner_key") \
.run()
import {
GrafanaLokiReportingSink,
GrafanaLokiReportingSinkOptions,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation
} from "@loadstrike/loadstrike-sdk";
const scenario = LoadStrikeScenario
.empty("orders-realtime-reporting")
.withLoadSimulations(LoadStrikeSimulation.inject(20, 1, 120));
const sink = new GrafanaLokiReportingSink(new GrafanaLokiReportingSinkOptions({
BaseUrl: "https://loki.example.com",
BearerToken: "loki-token",
TenantId: "platform-team",
MetricsBaseUrl: "https://otel-gateway.example.com",
MetricsEndpointPath: "/v1/metrics",
MetricsHeaders: {
Authorization: "Bearer otlp-metrics-token"
}
}));
await LoadStrikeRunner
.registerScenarios(scenario)
.withReportingSinks(sink)
.withRunnerKey("rkl_your_local_runner_key")
.run();
const {
GrafanaLokiReportingSink,
GrafanaLokiReportingSinkOptions,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation
} = require("@loadstrike/loadstrike-sdk");
(async () => {
const scenario = LoadStrikeScenario
.empty("orders-realtime-reporting")
.withLoadSimulations(LoadStrikeSimulation.inject(20, 1, 120));
const sink = new GrafanaLokiReportingSink(new GrafanaLokiReportingSinkOptions({
BaseUrl: "https://loki.example.com",
BearerToken: "loki-token",
TenantId: "platform-team",
MetricsBaseUrl: "https://otel-gateway.example.com",
MetricsEndpointPath: "/v1/metrics",
MetricsHeaders: {
Authorization: "Bearer otlp-metrics-token"
}
}));
await LoadStrikeRunner
.registerScenarios(scenario)
.withReportingSinks(sink)
.withRunnerKey("rkl_your_local_runner_key")
.run();
})();
GrafanaLokiReportingSinkOptions fields
Defaults to LoadStrike:ReportingSinks:GrafanaLoki when binding from infra config.
Required Loki base URL for log-style reporting events.
Loki push path for log events.
Authentication and tenancy fields used when the Loki backend requires them.
HTTP timeout for Loki writes.
Labels applied to exported Loki streams.
Optional OTLP/HTTP metrics endpoint base URL when projected metrics should go somewhere other than the Loki base URL.
Metrics write path for the OTLP/HTTP metrics companion endpoint.
Additional headers sent with projected metrics requests.
{
"LoadStrike": {
"ReportingSinks": {
"GrafanaLoki": {
"BaseUrl": "https://loki.example.com",
"BearerToken": "loki-token",
"MetricsBaseUrl": "https://otel-gateway.example.com",
"MetricsEndpointPath": "/v1/metrics",
"MetricsHeaders": {
"Authorization": "Bearer otlp-metrics-token"
}
}
}
}
}
Downloads and starter assets
These downloads cover the public Grafana Loki workflow that LoadStrike documents today.
Loki datasource YAML
A Grafana datasource definition for a Loki-backed LoadStrike dashboard setup.
Download fileDashboard provider YAML
The shared Grafana dashboard-provider file used by the published starter dashboards.
Download fileLoki dashboard JSON
A starter dashboard already wired for the Grafana Loki sink shape documented on this page.
Download file