cmotelexporter

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 14 Imported by: 0

README

cm-otel-exporter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCoordimapAPIKEy

func WithCoordimapAPIKEy(apiKey string) func(*CoordimapExporter) error

WithCoordimapAPIKEy sets the coordimap API Key.

func WithDataSourceInfoDescription

func WithDataSourceInfoDescription(description string) func(*CoordimapExporter) error

WithDataSourceInfoDescription sets the description of the data source.

func WithDataSourceInfoName

func WithDataSourceInfoName(name string) func(*CoordimapExporter) error

WithDataSourceInfoName sets the name of the data source.

func WithEndpoint

func WithEndpoint(endpointURL string) func(*CoordimapExporter) error

WithEndpoint sets the endpoint URL for the custom exporter.

Types

type CloudCrawlData

type CloudCrawlData struct {
	DataSource      DataSource  `json:"data_source"`
	CrawledData     CrawledData `json:"crawled_data"`
	Timestamp       time.Time   `json:"timestamp"`
	CrawlInternalID string      `json:"crawl_internal_id"`
}

CloudCrawlData the data structure that holds all the crawled information about the cloud

type CloudData

type CloudData struct {
	Data            json.RawMessage `json:"crawled_data"`
	Hash            string          `json:"hash"`
	Timestamp       time.Time       `json:"timestamp"`
	CrawlInternalID string          `json:"crawl_internal_id"`
}

CloudData contains all the crawled resources of the cloud Type

type CoordimapExporter

type CoordimapExporter struct {
	EndpointURL string

	CoordimapAPIKey string
	// contains filtered or unexported fields
}

CoordimapExporter is a custom OpenTelemetry span exporter that sends spans to an HTTP endpoint.

func NewCoordimapExporter

func NewCoordimapExporter(options ...func(*CoordimapExporter) error) (*CoordimapExporter, error)

NewCoordimapExporter creates a new instance of CustomExporter.

func (*CoordimapExporter) ExportSpans

func (e *CoordimapExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error

ExportSpans exports a batch of span data to the HTTP endpoint.

func (*CoordimapExporter) Shutdown

func (e *CoordimapExporter) Shutdown(ctx context.Context) error

Shutdown performs any necessary cleanup when the exporter is shut down.

type CrawledData

type CrawledData struct {
	Data []*Element `json:"data"`
}

CrawledData all the crawled elements of the specific cloud

type DataSource

type DataSource struct {
	Info   DataSourceInfo   `json:"data_source_info"`
	Config DataSourceConfig `json:"data_source_config"`
}

DataSource holds information about this specific data source

type DataSourceConfig

type DataSourceConfig struct {
	ValuePairs []KeyValue `json:"value_pairs"`
}

DataSourceConfig Structure that holds information about the configuration of data source that to be crawled. Any keys that contain "password" or "secret" will not be transferred.

type DataSourceInfo

type DataSourceInfo struct {
	Name string `json:"name"`
	Desc string `json:"desc"`
	Type string `json:"type"`
}

DataSourceInfo Structure that holds generic information regarding the data source that is being crawled.

type Element

type Element struct {
	RetrievedAt time.Time `json:"retrieved_at"`
	Name        string    `json:"name"`
	Type        string    `json:"type"`
	ID          string    `json:"id"`
	Hash        string    `json:"hash"`
	Data        []byte    `json:"data"`
	IsJSONData  bool      `json:"is_json_data"`
}

Element represents a single retrieved AWS element stored as JSON together with it's corresponding HASH and timestamp of retrieval

func CreateElement

func CreateElement(element interface{}, name, id, elemType string, crawlTime time.Time) (*Element, error)

CreateElement create a generic element

func CreateRelationship

func CreateRelationship(sourceID, destinationID, relationshipType, wrapperRelationshipType string, crawlTime time.Time) (*Element, error)

CreateRelationship create a relationship element

func (*Element) String

func (element *Element) String() string

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KeyValue holds a key value information

type RelationshipElement

type RelationshipElement struct {
	SourceID         string `json:"source_id"`
	DestinationID    string `json:"destination_id"`
	RelationshipType string `json:"relationship_type"`
}

RelationshipElement holds information about the relationship between two elements

type SubmitOtelCrawlDataRequest added in v0.1.1

type SubmitOtelCrawlDataRequest struct {
	CloudCrawlData CloudCrawlData `json:"cloud_crawl_data"`
}

SubmitOtelCrawlDataRequest The request data sent by the otel exporter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL