Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
emreyalvac committed Feb 12, 2023
1 parent 81f9f7c commit 98ca058
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .chloggen/cassandra-exporter-implementation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ component: cassandra_exporter
note: Cassandra exporter implementation

# One or more tracking issues related to the change
issues: [ ]
issues: [ 17910 ]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exporter/azuremonitorexporter/ @open-telemetry/collect
exporter/azuredataexplorerexporter/ @open-telemetry/collector-contrib-approvers @asaharan @ag-ramachandran
exporter/carbonexporter/ @open-telemetry/collector-contrib-approvers @pjanotti
exporter/clickhouseexporter/ @open-telemetry/collector-contrib-approvers @hanjm @dmitryax @Frapschen
exporter/cassandraexporter/ @open-telemetry/collector-contrib-approvers @emreyalvac
exporter/cassandraexporter/ @open-telemetry/collector-contrib-approvers @atuolme @emreyalvac
exporter/coralogixexporter/ @open-telemetry/collector-contrib-approvers @oded-dd @ofirshmuel
exporter/datadogexporter/ @open-telemetry/collector-contrib-approvers @mx-psi @gbbr @dineshg13 @liustanley @songy23
exporter/dynatraceexporter/ @open-telemetry/collector-contrib-approvers @dyladan @arminru @evan-bradley
Expand Down
22 changes: 5 additions & 17 deletions exporter/cassandraexporter/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Cassandra Exporter

| Status | |
|--------------------------|-----------|
| Stability | [alpha] |
| Supported pipeline types | traces |
| Distributions | [contrib] |
| Status | |
|--------------------------|--------------|
| Stability | [alpha] |
| Supported pipeline types | logs, traces |
| Distributions | [contrib] |

## Configuration options

Expand All @@ -21,12 +21,6 @@ The following settings can be optionally configured:
## Example

```yaml
receivers:
examplereceiver:
processors:
batch:
timeout: 5s
send_batch_size: 100000
exporters:
cassandra:
dsn: 127.0.0.1
Expand All @@ -37,10 +31,4 @@ exporters:
replication_factor: 1
compression:
algorithm: "ZstdCompressor"
service:
pipelines:
logs:
receivers: [ examplereceiver ]
processors: [ batch ]
exporters: [ cassandra ]
```
14 changes: 14 additions & 0 deletions exporter/cassandraexporter/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

type Config struct {
Expand Down
14 changes: 14 additions & 0 deletions exporter/cassandraexporter/constants.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

const (
Expand Down
16 changes: 15 additions & 1 deletion exporter/cassandraexporter/exporter_logs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

import (
Expand Down Expand Up @@ -98,7 +112,7 @@ func (e *logsExporter) pushLogsData(ctx context.Context, ld plog.Logs) error {
}

duration := time.Since(start)
e.logger.Info("insert logs", zap.Int("records", ld.LogRecordCount()),
e.logger.Debug("insert logs", zap.Int("records", ld.LogRecordCount()),
zap.String("cost", duration.String()))
return nil
}
16 changes: 15 additions & 1 deletion exporter/cassandraexporter/exporter_traces.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

import (
Expand Down Expand Up @@ -115,7 +129,7 @@ func (e *tracesExporter) pushTraceData(ctx context.Context, td ptrace.Traces) er
}

duration := time.Since(start)
e.logger.Info("insert traces", zap.Int("records", td.SpanCount()),
e.logger.Debug("insert traces", zap.Int("records", td.SpanCount()),
zap.String("cost", duration.String()))
return nil
}
16 changes: 15 additions & 1 deletion exporter/cassandraexporter/factory.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

import (
Expand All @@ -10,7 +24,7 @@ import (

const (
typeStr = "cassandra"
stability = component.StabilityLevelDevelopment
stability = component.StabilityLevelAlpha
)

func NewFactory() exporter.Factory {
Expand Down
14 changes: 14 additions & 0 deletions exporter/cassandraexporter/factory_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

import (
Expand Down
14 changes: 14 additions & 0 deletions exporter/cassandraexporter/helper.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cassandraexporter

import "go.opentelemetry.io/collector/pdata/pcommon"
Expand Down

0 comments on commit 98ca058

Please sign in to comment.