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
co-authored by achatterjee-grafana
parent 6c5d0db255
commit c02ead9113
9 changed files with 130 additions and 30 deletions
@@ -41,6 +41,14 @@ describe('Range Utils', () => {
expect(() => rangeUtil.describeInterval('123xyz')).toThrow();
expect(() => rangeUtil.describeInterval('xyz')).toThrow();
});
it('should be able to parse negative values as well', () => {
expect(rangeUtil.describeInterval('-50ms')).toEqual({
sec: 0.001,
type: 'ms',
count: -50,
});
});
});
describe('relativeToTimeRange', () => {
@@ -276,7 +276,7 @@ export function calculateInterval(range: TimeRange, resolution: number, lowLimit
};
}
const interval_regex = /(\d+(?:\.\d+)?)(ms|[Mwdhmsy])/;
const interval_regex = /(-?\d+(?:\.\d+)?)(ms|[Mwdhmsy])/;
// histogram & trends
const intervals_in_seconds = {
y: 31536000,