mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +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
|
@ -5,6 +5,7 @@ export * from './follows-command'
|
|||
export * from './follows'
|
||||
export * from './jobs'
|
||||
export * from './jobs-command'
|
||||
export * from './metrics-command'
|
||||
export * from './object-storage-command'
|
||||
export * from './plugins-command'
|
||||
export * from './redundancy-command'
|
||||
|
|
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
|
||||
})
|
||||
}
|
||||
}
|
|
@ -37,6 +37,7 @@ import { ContactFormCommand } from './contact-form-command'
|
|||
import { DebugCommand } from './debug-command'
|
||||
import { FollowsCommand } from './follows-command'
|
||||
import { JobsCommand } from './jobs-command'
|
||||
import { MetricsCommand } from './metrics-command'
|
||||
import { ObjectStorageCommand } from './object-storage-command'
|
||||
import { PluginsCommand } from './plugins-command'
|
||||
import { RedundancyCommand } from './redundancy-command'
|
||||
|
@ -104,6 +105,7 @@ export class PeerTubeServer {
|
|||
debug?: DebugCommand
|
||||
follows?: FollowsCommand
|
||||
jobs?: JobsCommand
|
||||
metrics?: MetricsCommand
|
||||
plugins?: PluginsCommand
|
||||
redundancy?: RedundancyCommand
|
||||
stats?: StatsCommand
|
||||
|
@ -377,6 +379,7 @@ export class PeerTubeServer {
|
|||
this.debug = new DebugCommand(this)
|
||||
this.follows = new FollowsCommand(this)
|
||||
this.jobs = new JobsCommand(this)
|
||||
this.metrics = new MetricsCommand(this)
|
||||
this.plugins = new PluginsCommand(this)
|
||||
this.redundancy = new RedundancyCommand(this)
|
||||
this.stats = new StatsCommand(this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue