Skip to content

Commit

Permalink
README: clarify go version support policy (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgajg1134 committed May 4, 2022
1 parent 8affd29 commit 61462f0
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 93 deletions.
55 changes: 7 additions & 48 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,15 @@
version: 2.1

plain-go114: &plain-go114
plain-go114: &plain-go116
working_directory: /home/circleci/dd-trace-go.v1
docker:
- image: circleci/golang:1.14
- image: circleci/golang:1.16
environment:
GOPATH: "/home/circleci/go"

jobs:
go1_12-build:
# Validate that the core builds with go1.12
parameters:
build_tags:
description: "go build tags used to compile"
default: ""
type: string
goflags:
description: "extra goflags to pass to go test"
default: ""
type: string
docker:
- image: circleci/golang:1.12
environment:
GOPATH: "/home/circleci/go"
working_directory: /home/circleci/dd-trace-go.v1
environment:
# Go 1.12 doesn't have the proxy turned on by default but we need it to
# fetch some dependencies that aren't handled by fetching directly
# (such as github.com/go-chi/chi/v4@v4.0.0-rc1)
GOPROXY: "https://proxy.golang.org"
steps:
- checkout

- run:
name: build
command: |
# Fixes fatal: unable to access 'https://gopkg.in/yaml.v3/': server certificate verification failed. CAfile: none CRLfile: none
# See https://github.com/DataDog/dd-trace-go/pull/1029
sudo apt update && sudo apt install ca-certificates libgnutls30 -y
go build -v -tags "<< parameters.build_tags >>" ./ddtrace/... ./profiler/... ./internal/appsec/...
metadata:
<<: *plain-go114
<<: *plain-go116

steps:
- checkout
Expand Down Expand Up @@ -79,7 +46,7 @@ jobs:
go run checkcopyright.go
lint:
<<: *plain-go114
<<: *plain-go116

steps:
- checkout
Expand Down Expand Up @@ -123,7 +90,7 @@ jobs:
environment: # environment variables for the build itself
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
DD_APPSEC_WAF_TIMEOUT: 1s
<<: *plain-go114
<<: *plain-go116

steps:
- checkout
Expand Down Expand Up @@ -171,7 +138,7 @@ jobs:
DD_APPSEC_WAF_TIMEOUT: 1s
working_directory: /home/circleci/dd-trace-go.v1
docker:
- image: circleci/golang:1.14
- image: circleci/golang:1.16
environment:
GOPATH: "/home/circleci/go"
- image: cassandra:3.7
Expand Down Expand Up @@ -334,6 +301,7 @@ jobs:
name: Testing outlier google.golang.org/api
command: |
go get google.golang.org/grpc@v1.29.0 # https://github.com/grpc/grpc-go/issues/3726
go mod tidy # Go1.16 doesn't update the sum file correctly after the go get, this tidy fixes it
go test -v ./contrib/google.golang.org/api/...
- run:
Expand Down Expand Up @@ -368,10 +336,6 @@ workflows:
version: 2
build-and-test:
jobs:
- go1_12-build:
matrix:
parameters:
build_tags: [ "", "appsec" ]
- metadata
- lint
- test-core:
Expand All @@ -391,11 +355,6 @@ workflows:
only:
- v1
jobs:
- go1_12-build:
matrix:
parameters:
build_tags: [ "", "appsec" ]
goflags: [ "-race" ]
- test-core:
matrix:
parameters:
Expand Down
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,53 @@ go get gopkg.in/DataDog/dd-trace-go.v1/contrib/gorilla/mux

If you installed more packages than you intended, you can use `go mod tidy` to remove any unused packages.

Requires:
### Documentation

- [API](https://pkg.go.dev/gopkg.in/DataDog/dd-trace-go.v1/ddtrace)
- [Tracing Go Applications](https://docs.datadoghq.com/tracing/setup/go/)
- [Continuous Go Profiler](https://docs.datadoghq.com/tracing/profiler/enabling/go).
- If you are migrating from an older version of the tracer (e.g. 0.6.x) you may also find the [migration document](MIGRATING.md) we've put together helpful.

### Support Policy

Datadog APM for Go is built upon dependencies defined in specific versions of the host operating system, Go releases, and the Datadog Agent/API. For Go the two latest releases are [GA](#support-ga) supported and the version before that is in [Maintenance](#support-maintenance). We do make efforts to support older releases, but generally these releases are considered [Legacy](#support-legacy). This library only officially supports [first class ports](https://github.com/golang/go/wiki/PortingPolicy#first-class-ports) of Go.

| **Level** | **Support provided** |
|--------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <span id="support-ga">General Availability (GA)</span> | Full implementation of all features. Full support for new features, bug & security fixes. |
| <span id="support-maintenance">Maintenance</span> | Full implementation of existing features. May receive new features. Support for bug & security fixes only. |
| <span id="support-legacy">Legacy</span> | Legacy implementation. May have limited function, but no maintenance provided. [Contact our customer support team for special requests.](https://www.datadoghq.com/support/) |

### Supported Versions

| **Go Version** | **Support level** |
|----------------|-------------------------------------|
| 1.18 | [GA](#support-ga) |
| 1.17 | [GA](#support-ga) |
| 1.16 | [Maintenance](#support-maintenance) |

* Go >= 1.12
* Datadog's Trace Agent >= 5.21.1

### Documentation
#### Package Versioning

A **Minor** version change will be released whenever a new version of Go is released. At that time the newest version of Go is added to [GA](#support-ga), the second oldest supported version moved to [Maintenance](#support-maintenance) and the oldest previously supported version dropped to [Legacy](#support-legacy).
**For example**:
For a dd-trace-go version 1.37.*

| Go Version | Support |
|------------|-------------------------------------|
| 1.18 | [GA](#support-ga) |
| 1.17 | [GA](#support-ga) |
| 1.16 | [Maintenance](#support-maintenance) |

Then after Go 1.19 is released there will be a new dd-trace-go version 1.38.0 with support:

The API is documented on [godoc](https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/ddtrace) as well as Datadog's official documentation for [Tracing Go Applications](https://docs.datadoghq.com/tracing/setup/go/) and the [Continuous Go Profiler](https://docs.datadoghq.com/tracing/profiler/enabling/go). If you are migrating from an older version of the tracer (e.g. 0.6.x) you may also find the [migration document](MIGRATING.md) we've put together helpful.
| Go Version | Support |
|------------|-------------------------------------|
| 1.19 | [GA](#support-ga) |
| 1.18 | [GA](#support-ga) |
| 1.17 | [Maintenance](#support-maintenance) |
| 1.16 | [Legacy](#support-legacy) |

### Contributing

Expand Down
9 changes: 9 additions & 0 deletions ddtrace/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
gocontext "context"
"os"
"runtime/pprof"
rt "runtime/trace"
"strconv"
"sync"
"time"
Expand Down Expand Up @@ -526,3 +527,11 @@ func (t *tracer) sample(span *span) {
}
t.prioritySampling.apply(span)
}

func startExecutionTracerTask(name string) func() {
if !rt.IsEnabled() {
return func() {}
}
_, task := rt.NewTask(gocontext.TODO(), name)
return task.End
}
21 changes: 0 additions & 21 deletions ddtrace/tracer/tracer_go11.go

This file was deleted.

12 changes: 0 additions & 12 deletions ddtrace/tracer/tracer_nongo11.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module gopkg.in/DataDog/dd-trace-go.v1

go 1.12
go 1.16

require (
cloud.google.com/go/pubsub v1.4.0
Expand Down
2 changes: 1 addition & 1 deletion profiler/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func logStartup(c *config) {
OSVersion string `json:"os_version"` // Version of the OS
Version string `json:"version"` // Profiler version
Lang string `json:"lang"` // "Go"
LangVersion string `json:"lang_version"` // Go version, e.g. go1.13
LangVersion string `json:"lang_version"` // Go version, e.g. go1.18
Hostname string `json:"hostname"`
DeltaProfiles bool `json:"delta_profiles"`
Service string `json:"service"`
Expand Down
7 changes: 1 addition & 6 deletions profiler/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ func (p *profiler) doRequest(bat batch) error {
}
cancel()
}()
// TODO(fg) use NewRequestWithContext once go 1.12 support is dropped.
req, err := http.NewRequest("POST", p.cfg.targetURL, body)
if err != nil {
return err
}
req = req.WithContext(ctx)
req, err := http.NewRequestWithContext(ctx, "POST", p.cfg.targetURL, body)
if p.cfg.apiKey != "" {
req.Header.Set("DD-API-KEY", p.cfg.apiKey)
}
Expand Down

0 comments on commit 61462f0

Please sign in to comment.