-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
component.go
32 lines (27 loc) · 1.18 KB
/
component.go
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
// 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 (
"github.com/DataDog/datadog-agent/comp/core/flare/helpers"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"go.uber.org/fx"
)
// team: agent-shared-components
// Component is the component type.
type Component interface {
// Create creates a new flare locally and returns the path to the flare file.
Create(pdata ProfileData, ipcError error) (string, error)
// Send sends a flare archive to Datadog.
Send(flarePath string, caseID string, email string, source helpers.FlareSource) (string, error)
}
// Module defines the fx options for this component.
func Module() fxutil.Module {
return fxutil.Component(
fx.Provide(newFlare))
}