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:
parent
0e6cd1c00f
commit
fd3c2e8705
35 changed files with 748 additions and 127 deletions
18
shared/server-commands/server/metrics-command.ts
Normal file
18
shared/server-commands/server/metrics-command.ts
Normal 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
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue