GithubHelp home page GithubHelp logo

golang-money's Introduction

We have adopted OTEL instead.

Money

Distributed Tracing using Go

This is the Go implementation of Money

Build Status codecov.io Go Report Card Quality Gate Status Apache V2 License GitHub Release GoDoc

A Money header looks like the following

Money: trace-id=YourTraceId;parent-id=12345;span-id=12346;span-name=YourSpanName;start-time=2016-02-15T20:30:46.782538292Z;span-duration=3000083865;error-code=200;span-success=true
Span Data Description
spanId current span's identifier
traceId name for the trace
parentId current span's parent identifier
spanName current span's name
startTime current span's start time
spanDuration current span's duration time
errorCode current span's error code
spanSuccess Was the current span successful

Functionality to handle the Money header can be added in two ways

1. Decorate you're handlers with the Money handler

Money.Decorate( [http.Handler], Money.AddToHandler( [spanName] ))

2. Use the Money Begin and End functions by adding them to your http.Handler

Start server and make a request that includes a Money header

The basics to start a Money trace are a trace id name and starting span id number.

Money:trace-id=YourTraceId;span-id=12345;

golang-money's People

Contributors

denopink avatar dependabot[bot] avatar joe94 avatar johnabass avatar kcajmagic avatar kraj avatar kristinapathak avatar njharter avatar schmidtw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golang-money's Issues

Need option for handlers that redirect

Currently the decorator does not handle a state when outbound requests are forwarded through redirectHandlers. This is how Petasos handles outbound requests.

Don't leave parados clients behind.

Parados clients should be able to start and receive spans on their own accord without communicating with the xmidt team. For this to work spanner's decorate function must take into account a case that indicates whether or not a parados client wants Money. This feature is dependent off acknowledging the issue in unison with wrp-C & parados.

Currently decorate will only function if a HTTP header contains a money trace. As of now wrp-C (and to my knowledge, parados) does not contain the needed fields for money to be utilized.

Adding entries to X-MoneyTrace header

I'm working on some changes to the Scala Money library and I was looking at being able to propagate additional state about the span context across the Money headers. As the header is already a delimited set of name/value pairs it seemed like it would be fine to add additional values into the existing header:

X-MoneyTrace: trace-id=9121d79c-ce07-481e-b822-7f829bdd5186;parent-id=91877731;span-id=49430499;sampled=1;foo=bar

However I noticed that the Go implementation of money assumes that there can only be 3 key value pairs otherwise it fails to parse the header.

I was curious as to how much impact there could be in making this change to the X-MoneyTrace header (specifically how many Go services might be impacted due to requests coming from JVM-based services), and whether it might be possible to implement this change.

I've submitted a PR to implement this change: #44

@ptravers

CVE-2022-28948 (Medium) detected in github.com/go-yaml/yaml-v2.4.0 - autoclosed

CVE-2022-28948 - Medium Severity Vulnerability

Vulnerable Library - github.com/go-yaml/yaml-v2.4.0

YAML support for the Go language.

Dependency Hierarchy:

  • github.com/stretchr/testify/assert-v1.6.1 (Root Library)
    • โŒ github.com/go-yaml/yaml-v2.4.0 (Vulnerable Library)

Found in base branch: main

Vulnerability Details

An issue in the Unmarshal function in Go-Yaml v3 causes the program to crash when attempting to deserialize invalid input.

Publish Date: 2022-05-19

URL: CVE-2022-28948

CVSS 3 Score Details (5.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Local
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-fm53-mpmp-7qw2

Release Date: 2022-05-19

Fix Resolution: v3.0.0


Step up your Open Source Security Game with Mend here

Update Readme

We're starting to make changes to the code and the readme will have to reflect such changes.

X-MoneyTrace or Money

I noticed in the documentation of this project it says the header should be:

Money: trace-id=YourTraceId;parent-id=12345;span-id=12346;span-name=YourSpanName;start-time=2016-02-15T20:30:46.782538292Z;span-duration=3000083865;error-code=200;span-success=true

But in the documentation of the project that this implements, it says the header should be:

X-MoneyTrace: trace-id=de305d54-75b4-431b-adb2-eb6b9e546013;parent-id=3285573610483682037;span-id=3285573610483682037

What header should it be? X-MoneyTrace or Money ?

Thanks

Create Map() function

Similar to func (t *HTTPTracker) String() (v string) {} a method func (t *HTTPTracker) Map() map[string]string {} is needed to store spans as map values.

Clarify the data format for httptracker's spans method

It is still misunderstood whether to use a list of map[string]string or a list of strings to store a trace's spans that allow optimal conditions to communicate with WRP. Spans() []string method must be updated when this issue has come to fruition.

type Tracker interface {
          ....
	// Spans returns a list of string-encoded Money spans that have been created under this tracker
	Spans() []string
}

Refactor Finish() for clarity.

Allow Finish() to return a result struct to allow the user to use their newly acquired span info - such task could be using it to write to headers.

Rename master branch to main

Also have to change references to the branch in .travis.yml, README, and CONTRIBUTING. Double check any other markdown files as well - sometimes links have the branch name in them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.