Tracing: add way to configure trace to logs start and end time (#34995)

* Tracing: add way to configure trace to logs start and end time

* Use the span's time by default

* Update docs

* Update time inputs to use strings instead of number

* Support negative values as well

* Add info about using negative value

* Don't round up Loki range

* Update docs/sources/datasources/jaeger.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Wording for doc

* Round adjusted start and end time

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
Zoltán Bedi
2021-07-12 11:25:41 +02:00
committed by GitHub
parent 6c5d0db255
commit c02ead9113
9 changed files with 130 additions and 30 deletions

View File

@@ -184,14 +184,10 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
this.adjustInterval((options as DataQueryRequest<LokiQuery>).intervalMs || 1000, rangeMs) / 1000;
// We want to ceil to 3 decimal places
const step = Math.ceil(adjustedInterval * 1000) / 1000;
const alignedTimes = {
start: startNs - (startNs % 1e9),
end: endNs + (1e9 - (endNs % 1e9)),
};
range = {
start: alignedTimes.start,
end: alignedTimes.end,
start: startNs,
end: endNs,
step,
};
}