Skip to content

Commit

Permalink
Renamed "OpenTelemetry Service" to "OpenTelemetry Collector"
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
jpkrohling committed Sep 26, 2019
1 parent c34c7a5 commit a642729
Show file tree
Hide file tree
Showing 37 changed files with 291 additions and 298 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -38,11 +38,11 @@ Once minikube has finished starting, get the Operator running:
make run
```

At this point, an OpenTelemetry Service instance can be installed:
At this point, an OpenTelemetry Collector instance can be installed:

```
kubectl apply -f deploy/examples/simplest.yaml
kubectl get otelsvcs
kubectl get otelcols
kubectl get pods
```

Expand All @@ -54,7 +54,7 @@ kubectl delete -f deploy/examples/simplest.yaml

#### Model changes

The Operator SDK generates the `pkg/apis/opentelemetry/v1alpha1//zz_generated.*.go` files via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/opentelemetry/v1alpha1//opentelemetryservice_types.go`)
The Operator SDK generates the `pkg/apis/opentelemetry/v1alpha1//zz_generated.*.go` files via the command `make generate`. This should be executed whenever there's a model change (`pkg/apis/opentelemetry/v1alpha1//opentelemetrycollector_types.go`)

#### Tests

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -12,9 +12,9 @@ NAMESPACE ?= "${USER}"
BUILD_IMAGE ?= "${NAMESPACE}/${OPERATOR_NAME}:latest"
OUTPUT_BINARY ?= "${BIN_DIR}/${OPERATOR_NAME}"
VERSION_PKG ?= "github.com/open-telemetry/opentelemetry-operator/pkg/version"
LD_FLAGS ?= "-X ${VERSION_PKG}.version=${OPERATOR_VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.otelSvc=${OTELSVC_VERSION}"
LD_FLAGS ?= "-X ${VERSION_PKG}.version=${OPERATOR_VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.otelCol=${OTELSVC_VERSION}"

OTELSVC_VERSION ?= "$(shell grep -v '\#' opentelemetry.version | grep opentelemetry-service | awk -F= '{print $$2}')"
OTELSVC_VERSION ?= "$(shell grep -v '\#' opentelemetry.version | grep opentelemetry-collector | awk -F= '{print $$2}')"

PACKAGES := $(shell go list ./cmd/... ./pkg/...)

Expand Down Expand Up @@ -69,7 +69,7 @@ clean:

.PHONY: crd
crd:
@kubectl create -f deploy/crds/opentelemetry_v1alpha1_opentelemetryservice_crd.yaml 2>&1 | grep -v "already exists" || true
@kubectl create -f deploy/crds/opentelemetry_v1alpha1_opentelemetrycollector_crd.yaml 2>&1 | grep -v "already exists" || true

.PHONY: generate
generate:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -4,25 +4,25 @@

The OpenTelemetry Operator is an implementation of a [Kubernetes Operator](https://coreos.com/operators/).

At this point, it has [OpenTelemetry Service](https://github.com/open-telemetry/opentelemetry-service) as the only managed component.
At this point, it has [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-service) as the only managed component.

## Getting started

To install the operator, run:
```
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/crds/opentelemetry_v1alpha1_opentelemetryservice_crd.yaml
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/crds/opentelemetry_v1alpha1_opentelemetrycollector_crd.yaml
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/service_account.yaml
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/role.yaml
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/role_binding.yaml
kubectl create -f https://raw.githubusercontent.com/jpkrohling/opentelemetry-operator/master/deploy/operator.yaml
```

Once the `opentelemetry-operator` deployment is ready, create an OpenTelemetry Service (otelsvc) instance, like:
Once the `opentelemetry-operator` deployment is ready, create an OpenTelemetry Collector (otelcol) instance, like:

```
kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryService
kind: OpenTelemetryCollector
metadata:
name: simplest
spec:
Expand All @@ -43,11 +43,11 @@ spec:
exporters: [logging]
```

This will create an OpenTelemetry Service instance named `simplest`, exposing a `jaeger-grpc` port to consume spans from your instrumented applications and exporting those spans via `jaeger-grpc` to a remote Jaeger collector.
This will create an OpenTelemetry Collector instance named `simplest`, exposing a `jaeger-grpc` port to consume spans from your instrumented applications and exporting those spans via `jaeger-grpc` to a remote Jaeger collector.

The `config` node holds the `YAML` that should be passed down as-is to the underlying OpenTelemetry Service instances. Refer to the [OpenTelemetry Service](https://github.com/open-telemetry/opentelemetry-service) documentation for a reference of the possible entries.
The `config` node holds the `YAML` that should be passed down as-is to the underlying OpenTelemetry Collector instances. Refer to the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-service) documentation for a reference of the possible entries.

At this point, the Operator does *not* validate the contents of the configuration file: if the configuration is invalid, the instance will still be created but the underlying OpenTelemetry Service might crash.
At this point, the Operator does *not* validate the contents of the configuration file: if the configuration is invalid, the instance will still be created but the underlying OpenTelemetry Collector might crash.

## Contributing and Developing

Expand All @@ -62,7 +62,7 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
[goreport-img]: https://goreportcard.com/badge/github.com/jpkrohling/opentelemetry-operator
[goreport]: https://goreportcard.com/report/github.com/jpkrohling/opentelemetry-operator
[godoc-img]: https://godoc.org/github.com/jpkrohling/opentelemetry-operator?status.svg
[godoc]: https://godoc.org/github.com/jpkrohling/opentelemetry-operator/pkg/apis/opentelemetry/v1alpha1#OpenTelemetryService
[godoc]: https://godoc.org/github.com/jpkrohling/opentelemetry-operator/pkg/apis/opentelemetry/v1alpha1#OpenTelemetryCollector
[code-climate]: https://codeclimate.com/github/jpkrohling/opentelemetry-operator/maintainability
[code-climate-img]: https://api.codeclimate.com/v1/badges/7bb215eea77fc9c24484/maintainability
[codecov]: https://codecov.io/gh/jpkrohling/opentelemetry-operator
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/main.go
Expand Up @@ -44,7 +44,7 @@ func printVersion() {
v := version.Get()
log.Info("Starting the OpenTelemetry Operator",
"opentelemetry-operator", v.Operator,
"opentelemetry-service", v.OpenTelemetryService,
"opentelemetry-collector", v.OpenTelemetryCollector,
"build-date", v.BuildDate,
"go-version", v.Go,
"go-arch", runtime.GOARCH,
Expand Down Expand Up @@ -119,7 +119,7 @@ func main() {
os.Exit(1)
}

ctxUpgrade := context.WithValue(ctx, opentelemetry.ContextLogger, logf.Log.WithName("upgrade_opentelemetryservice"))
ctxUpgrade := context.WithValue(ctx, opentelemetry.ContextLogger, logf.Log.WithName("upgrade_opentelemetrycollector"))
if err := upgrade.ManagedInstances(ctxUpgrade, mgr.GetClient()); err != nil {
log.Error(err, "failed to upgrade managed instances")
}
Expand Down
71 changes: 0 additions & 71 deletions deploy/crds/opentelemetry.io_opentelemetryservices_crd.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions deploy/crds/opentelemetry_v1alpha1_opentelemetrycollector_crd.yaml
@@ -0,0 +1,66 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: opentelemetrycollectors.opentelemetry.io
spec:
group: opentelemetry.io
names:
kind: OpenTelemetryCollector
listKind: OpenTelemetryCollectorList
plural: opentelemetrycollectors
shortNames:
- otelcol
- otelcols
singular: opentelemetrycollector
scope: Namespaced
subresources:
scale:
specReplicasPath: .spec.replicas
statusReplicasPath: .status.replicas
status: {}
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
args:
additionalProperties:
type: string
type: object
config:
description: +required
type: string
image:
type: string
replicas:
format: int32
type: integer
type: object
status:
properties:
replicas:
format: int32
type: integer
version:
type: string
required:
- replicas
- version
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
2 changes: 1 addition & 1 deletion deploy/crds/simplest.yaml
@@ -1,5 +1,5 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryService
kind: OpenTelemetryCollector
metadata:
name: simplest
spec:
Expand Down
Expand Up @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[{"apiVersion":"opentelemetry.io/v1alpha1","kind":"OpenTelemetryService","metadata":{"name":"example-opentelemetryservice"},"spec":{"size":3}}]'
alm-examples: '[{"apiVersion":"opentelemetry.io/v1alpha1","kind":"OpenTelemetryCollector","metadata":{"name":"example-opentelemetrycollector"},"spec":{"size":3}}]'
capabilities: Basic Install
name: opentelemetry-operator.v0.0.1
namespace: placeholder
Expand Down
@@ -1,14 +1,14 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: opentelemetryservices.opentelemetry.io
name: opentelemetrycollectors.opentelemetry.io
spec:
group: opentelemetry.io
names:
kind: OpenTelemetryService
listKind: OpenTelemetryServiceList
plural: opentelemetryservices
singular: opentelemetryservice
kind: OpenTelemetryCollector
listKind: OpenTelemetryCollectorList
plural: opentelemetrycollectors
singular: opentelemetrycollector
scope: Namespaced
subresources:
status: {}
Expand Down
4 changes: 2 additions & 2 deletions examples/business-application.yaml
@@ -1,5 +1,5 @@
# when `simplest.yaml` is deployed, this is how an application containing the Jaeger client can be configured to use otelsvc
# in this case, we make use of the jaeger-agent as a sidecar, and the jaeger-agent connects to otelsvc via gRPC
# when `simplest.yaml` is deployed, this is how an application containing the Jaeger client can be configured to use otelcol
# in this case, we make use of the jaeger-agent as a sidecar, and the jaeger-agent connects to otelcol via gRPC
# this is suitable when the application is already configured to talk to Jaeger via UDP
# for greenfield applications, the OpenTelemetry client should be preferred
apiVersion: apps/v1
Expand Down
2 changes: 1 addition & 1 deletion examples/simplest.yaml
@@ -1,5 +1,5 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryService
kind: OpenTelemetryCollector
metadata:
name: simplest
spec:
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/opentelemetry/const.go
Expand Up @@ -6,7 +6,7 @@ type (
)

const (
// ContextInstance is the OpenTelemetryService CR (instance) that is the current target of the reconciliation
// ContextInstance is the OpenTelemetryCollector CR (instance) that is the current target of the reconciliation
ContextInstance ContextEntry = "__instance"

// ContextLogger represents the context entry for the logger instance to be used for context-dependent log entries
Expand All @@ -15,6 +15,6 @@ const (
// CollectorConfigMapEntry represents the configuration file name for the collector
CollectorConfigMapEntry = "collector.yaml"

// OtelSvcImageConfigKey represents the key to override the OpenTelemetry Service container image
OtelSvcImageConfigKey = "otelsvc-image"
// OtelColImageConfigKey represents the key to override the OpenTelemetry Collector container image
OtelColImageConfigKey = "otelcol-image"
)
8 changes: 4 additions & 4 deletions pkg/apis/opentelemetry/flagset.go
Expand Up @@ -20,11 +20,11 @@ func FlagSet() *pflag.FlagSet {

fs = pflag.NewFlagSet("opentelemetry-operator", pflag.ExitOnError)
fs.String(
OtelSvcImageConfigKey,
"quay.io/opentelemetry/opentelemetry-service:v0.0.2",
"The default image to use for OpenTelemetry Service when not specified in the individual custom resource (CR)",
OtelColImageConfigKey,
"quay.io/opentelemetry/opentelemetry-collector:v0.0.2",
"The default image to use for OpenTelemetry Collector when not specified in the individual custom resource (CR)",
)
viper.BindPFlag(OtelSvcImageConfigKey, fs.Lookup(OtelSvcImageConfigKey))
viper.BindPFlag(OtelColImageConfigKey, fs.Lookup(OtelColImageConfigKey))
}

return fs
Expand Down

0 comments on commit a642729

Please sign in to comment.