1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add playback metric endpoint sent to OTEL

This commit is contained in:
Chocobozzz 2022-08-12 16:41:29 +02:00
parent 0e6cd1c00f
commit fd3c2e8705
No known key found for this signature in database
GPG key ID: 583A612D890159BE
35 changed files with 748 additions and 127 deletions

View file

@ -0,0 +1,18 @@
import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
export class MetricsCommand extends AbstractCommand {
addPlaybackMetric (options: OverrideCommandOptions & { metrics: PlaybackMetricCreate }) {
const path = '/api/v1/metrics/playback'
return this.postBodyRequest({
...options,
path,
fields: options.metrics,
implicitToken: false,
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
})
}
}