Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addressed PR comments
  • Loading branch information
agoallikmaa committed Nov 19, 2021
commit d49bafc9e53ac27e7dcd4334e16b4155b8588131
3 changes: 3 additions & 0 deletions receiver/cloudfoundryreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ type RLPGatewayConfig struct {
ShardID string `mapstructure:"shard_id"`
}

// LimitedTLSClientSetting is a subset of TLSClientSetting, see LimitedHTTPClientSettings for more details
type LimitedTLSClientSetting struct {
InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"`
}

// LimitedHTTPClientSettings is a subset of HTTPClientSettings, implemented as a separate type due to the library this
// configuration is used with not taking a preconfigured http.Client as input, but only taking these specific options
type LimitedHTTPClientSettings struct {
Endpoint string `mapstructure:"endpoint"`
TLSSetting LimitedTLSClientSetting `mapstructure:"tls,omitempty"`
Expand Down
10 changes: 7 additions & 3 deletions receiver/cloudfoundryreceiver/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
"go.opentelemetry.io/collector/model/pdata"
)

const (
attributeNamePrefix = "org.cloudfoundry."
)

func convertEnvelopeToMetrics(envelope *loggregator_v2.Envelope, metricSlice pdata.MetricSlice, startTime time.Time) {
namePrefix := envelope.Tags["origin"] + "."

Expand Down Expand Up @@ -51,14 +55,14 @@ func convertEnvelopeToMetrics(envelope *loggregator_v2.Envelope, metricSlice pda

func copyEnvelopeAttributes(attributes pdata.AttributeMap, envelope *loggregator_v2.Envelope) {
for key, value := range envelope.Tags {
attributes.InsertString(key, value)
attributes.InsertString(attributeNamePrefix + key, value)
}

if envelope.SourceId != "" {
attributes.InsertString("source_id", envelope.SourceId)
attributes.InsertString(attributeNamePrefix + "source_id", envelope.SourceId)
}

if envelope.InstanceId != "" {
attributes.InsertString("instance_id", envelope.InstanceId)
attributes.InsertString(attributeNamePrefix + "instance_id", envelope.InstanceId)
}
}
2 changes: 0 additions & 2 deletions receiver/cloudfoundryreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
const (
typeStr = "cloudfoundry"
defaultUAAUsername = "admin"
defaultUAAPassword = "default"
defaultRLPGatewayShardID = "opentelemetry"
defaultURL = "https://localhost"
)
Expand Down Expand Up @@ -63,7 +62,6 @@ func createDefaultConfig() config.Receiver {
},
},
Username: defaultUAAUsername,
Password: defaultUAAPassword,
},
}
}
Expand Down