Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: adding support for AWS X-RAY #1987

Merged
merged 29 commits into from
Feb 27, 2023
Merged

Conversation

xoscar
Copy link
Collaborator

@xoscar xoscar commented Feb 13, 2023

This PR enables Amazon X-Ray as a data store for Tracetest.

Changes

  • Adds a Node.js example to use Tracetest with X-Ray
  • Includes BE and FE support for the new Data Store

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

Using AWS XRAY SDK to instrument plus the ADOT COllector

https://www.loom.com/share/5441578aef2442c78684916834335428

Using AWX XRAY SDK to instrument plus AWS XRAY SDK to pull Traces

https://www.loom.com/share/4ca15c89ba48455b813d6c605c828063

Using OpenTelemetry (Pokeshop) to instrument plus XRAY ADOT collector exporter plus AWS XRAY SDK to pull Traces

https://www.loom.com/share/3a4f3ad4955a4390ae475c18cad30f99

@xoscar xoscar added frontend backend tracing backend Improve or implement support for a new tracing backend labels Feb 13, 2023
@xoscar xoscar self-assigned this Feb 13, 2023
@xoscar xoscar linked an issue Feb 13, 2023 that may be closed by this pull request
@xoscar xoscar marked this pull request as ready for review February 13, 2023 21:13
schoren and others added 10 commits February 14, 2023 14:07
* added quick-start golnag app in example

* Added quick-start-python in examples
* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd
* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information
* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
tid := trace.TraceID{}
g.rand.Read(tid[:])
return tid
var r [16]byte
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathnogueira @schoren there is quite an annoying rule by x-ray that requires traces to include a prefix to calculate the creation time, if the trace is older than 30 days the API returns an error, if the prefix is missing x-ray returns an error, I have this code here knowing that is wrong to put it in this place, should we also support a different way of creating traces based on data store? I'm open to ideas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brainstorming: Maybe we should have specializations of this generator (or about the traceid logic) and do something similar with the connectivity PR?

@@ -0,0 +1,801 @@
package tracedb

import (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big chunky file that contains everything related to the x-ray connectivity and parsing of the data

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to create a package for XRay inside of tracedb and break this file by responsibilities/concerns?

examples/tracetest-amazon-x-ray-adot/.env Outdated Show resolved Hide resolved
properties:
region:
type: string
accessKeyId:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To think of tech debt in the future: this is sensitive data that we should store in our database hashed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be addressed in a separate PR

tid := trace.TraceID{}
g.rand.Read(tid[:])
return tid
var r [16]byte
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brainstorming: Maybe we should have specializations of this generator (or about the traceid logic) and do something similar with the connectivity PR?


spans = append(spans, nestedSpans...)

// if seg.Cause != nil &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this code?


func convertToAmazonTraceID(traceID trace.TraceID) (string, error) {
const (
// maxAge of 28 days. AWS has a 30 day limit, let's be conservative rather than
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// maxAge of 28 days. AWS has a 30 day limit, let's be conservative rather than
// maxAge of 28 days in seconds. AWS has a 30-day limit, let's be conservative rather than

@@ -0,0 +1,801 @@
package tracedb

import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to create a package for XRay inside of tracedb and break this file by responsibilities/concerns?

@xoscar xoscar changed the base branch from main to new-config February 22, 2023 21:16
@xoscar xoscar changed the base branch from new-config to main February 22, 2023 21:16
@xoscar xoscar changed the base branch from main to new-config February 22, 2023 21:54
@xoscar xoscar merged commit 427db01 into new-config Feb 27, 2023
@xoscar xoscar deleted the 179-support-amazon-x-ray branch February 27, 2023 17:56
schoren added a commit that referenced this pull request Feb 28, 2023
* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>
schoren added a commit that referenced this pull request Mar 1, 2023
* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>
xoscar added a commit that referenced this pull request Mar 1, 2023
* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* feature(examples): adding aws terraform example

* updating the tracetest image

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* feat: config deprecation (#2015)

* update options to use named fields

* add postgresConnString as deprecated

* remove nil validations

* fix deprecated config fields detection

* add logger to config New function

* replace zap with go's log package

* invert logic of printing the deprecation note

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* unexport logger interface

* use camelCase names in tests

* update test with Sebastian notes and update logic to make it pass

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* fix: postgres config retrocompatibility  (#2043)

feat: ensure retrocompatibility if users is using postgresConnString

* feature: adding support for AWS X-RAY (#1987)

* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>

* feature(examples) adding tracetest x aws-xray examples (#2030)

* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* feature(examples) adding tracetest x aws-xray examples

* cleanup

* cleanup

* removing mysql dependency

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
schoren added a commit that referenced this pull request Mar 2, 2023
* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>
schoren added a commit that referenced this pull request Mar 3, 2023
* feature: adding support for AWS X-RAY

* updating README

* cleanup

* feat(server): implement viper (#1977)

* added quick-start golang app in example (#1940)

* added quick-start golnag app in example

* Added quick-start-python in examples

* chore(docs): add recipe for datadog (#1995)

* chore(examples): adding documentation and example of datadog integration

* adding datadog recipe

* fixing details in docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

---------

Co-authored-by: Julianne Fermi <julianne@kubeshop.io>

* Update docs structure and config guides (#1984)

* docs(1919): flatten tools and integration

* docs(1919): flatten examples and tutorials

* docs(recipes): edit naming

* docs(config): fix 1982

* examples(tempo): edit config

* docs(structure): add redirect

* docs(config): update dd

* feature(examples): adding net core x tracetest example (#1978)

* feature(examples): adding net core x tracetest example

* adding readme

* addressing feedback comments

* adding more information

* adding support for the native xray client

* refactor connectivity test to reuse components (#1994)

* refactor connectivity test to reuse components

* only run next step if previous step succeeded

* simplify tester TestConnection

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* add protocol in IsReachable function

* ignore unused ctx

* remove boolean return from IsReachable

* use multierrors to wrap all endpoint errors

* fix build

* use const for IsReachable timeout

* rename IsReachable to CheckReachability

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>

* cleanup

* using the new test connection logic

* config(server): allow provisioning from file or environent variable (#1999)

* cleanup

* adding support for session token

* feat(server): implement viper (#1977)

* config(server): allow provisioning from file or environent variable (#1999)

* moving trace id generation to data store

* fixing unit tests

* chore: disable application exporter in demo (#2012)

disable app exporter in demo

* removing examples

* cleanup

---------

Co-authored-by: Sebastian Choren <schoren@users.noreply.github.com>
Co-authored-by: Mahesh Kasbe <60398112+maheshkasabe@users.noreply.github.com>
Co-authored-by: Daniel Baptista Dias <danielbdias@users.noreply.github.com>
Co-authored-by: Julianne Fermi <julianne@kubeshop.io>
Co-authored-by: Adnan Rahić <adnan@kubeshop.io>
Co-authored-by: Matheus Nogueira <matheus.nogueira2008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend frontend tracing backend Improve or implement support for a new tracing backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Amazon x-ray
7 participants