-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathcomponent.go
More file actions
43 lines (35 loc) · 1.84 KB
/
Copy pathcomponent.go
File metadata and controls
43 lines (35 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
// Package flare implements a component to generate flares from the agent.
//
// A flare is a archive containing all the information necessary to troubleshoot the Agent. When openeing a support
// ticket a flare might be requested. Flares contain the Agent logs, configurations and much more.
package flare
import (
"time"
"go.uber.org/fx"
"github.com/DataDog/datadog-agent/comp/core/flare/helpers"
"github.com/DataDog/datadog-agent/comp/core/flare/types"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
)
// team: agent-configuration
// Component is the component type.
type Component interface {
// Create creates a new flare locally and returns the path to the flare file.
//
// If providerTimeout is 0 or negative, the timeout from the configuration will be used.
Create(pdata types.ProfileData, providerTimeout time.Duration, ipcError error, diagnoseResult []byte) (string, error)
// CreateWithArgs creates a new flare locally and returns the path to the flare file.
// This function is used to create a flare with specific arguments.
CreateWithArgs(flareArgs types.FlareArgs, providerTimeout time.Duration, ipcError error, diagnoseResult []byte) (string, error)
// Send sends a flare archive to Datadog. The local archive is removed after a successful upload unless the component was created with KeepArchiveAfterSend (e.g. CLI --keep-archive).
Send(flarePath string, caseID string, email string, source helpers.FlareSource) (string, error)
}
// Module defines the fx options for this component.
func Module(params Params) fxutil.Module {
return fxutil.Component(
fx.Provide(newFlare),
fx.Supply(params))
}