Zipkin-go: Zipkin Distributed Tracing Library for Go

Zipkin Library for Go

Zipkin Go is the official Go Tracer / Tracing implementation for Zipkin, supported by the OpenZipkin community.

package organization

zipkin-go is built with interoperability in mind within the OpenZipkin community and even 3rd parties, the library consists of several packages.

The main tracing implementation can be found in the root folder of this repository. Reusable parts not considered core implementation or deemed beneficiary for usage by others are placed in their own packages within this repository.

model

This library implements the Zipkin V2 Span Model which is available in the model package. It contains a Go data model compatible with the Zipkin V2 API and can automatically sanitize, parse and (de)serialize to and from the required JSON representation as used by the official Zipkin V2 Collectors.

propagation

The propagation package and B3 subpackage hold the logic for propagating SpanContext (span identifiers and sampling flags) between services participating in traces. Currently Zipkin B3 Propagation is supported for HTTP and GRPC.

middleware

The middleware subpackages contain officially supported middleware handlers and tracing wrappers.

http

An easy to use http.Handler middleware for tracing server side requests is provided. This allows one to use this middleware in applications using standard library servers as well as most available higher level frameworks. Some frameworks will have their own instrumentation and middleware that maps better for their ecosystem.

For HTTP client operations NewTransport can return a http.RoundTripper implementation that can either wrap the standard http.Client's Transport or a custom provided one and add per request tracing. Since HTTP Requests can have one or multiple redirects it is advisable to always enclose HTTP Client calls with a Span either around the *http.Client call level or parent function level.

For convenience NewClient is provided which returns a HTTP Client which embeds *http.Client and provides an application span around the HTTP calls when calling the DoWithAppSpan() method.

grpc

Easy to use grpc.StatsHandler middleware are provided for tracing gRPC server and client requests.

For a server, pass NewServerHandler when calling NewServer, e.g.,

import (
    "google.golang.org/grpc"
    zipkingrpc "github.com/openzipkin/zipkin-go/middleware/grpc"
)

server = grpc.NewServer(grpc.StatsHandler(zipkingrpc.NewServerHandler(tracer)))

For a client, pass NewClientHandler when calling Dial, e.g.,

import (
    "google.golang.org/grpc"
    zipkingrpc "github.com/openzipkin/zipkin-go/middleware/grpc"
)

conn, err = grpc.Dial(addr, grpc.WithStatsHandler(zipkingrpc.NewClientHandler(tracer)))

reporter

The reporter package holds the interface which the various Reporter implementations use. It is exported into its own package as it can be used by 3rd parties to use these Reporter packages in their own libraries for exporting to the Zipkin ecosystem. The zipkin-go tracer also uses the interface to accept 3rd party Reporter implementations.

HTTP Reporter

Most common Reporter type used by Zipkin users transporting Spans to the Zipkin server using JSON over HTTP. The reporter holds a buffer and reports to the backend asynchronously.

Kafka Reporter

High performance Reporter transporting Spans to the Zipkin server using a Kafka Producer digesting JSON V2 Spans. The reporter uses the Sarama async producer underneath.

usage and examples

HTTP Server Example


Download Details:

Author: Openzipkin
Source Code: https://github.com/openzipkin/zipkin-go 
License: Apache-2.0 license

#go #golang #traces #distribution 

What is GEEK

Buddha Community

Zipkin-go: Zipkin Distributed Tracing Library for Go

Zipkin-go: Zipkin Distributed Tracing Library for Go

Zipkin Library for Go

Zipkin Go is the official Go Tracer / Tracing implementation for Zipkin, supported by the OpenZipkin community.

package organization

zipkin-go is built with interoperability in mind within the OpenZipkin community and even 3rd parties, the library consists of several packages.

The main tracing implementation can be found in the root folder of this repository. Reusable parts not considered core implementation or deemed beneficiary for usage by others are placed in their own packages within this repository.

model

This library implements the Zipkin V2 Span Model which is available in the model package. It contains a Go data model compatible with the Zipkin V2 API and can automatically sanitize, parse and (de)serialize to and from the required JSON representation as used by the official Zipkin V2 Collectors.

propagation

The propagation package and B3 subpackage hold the logic for propagating SpanContext (span identifiers and sampling flags) between services participating in traces. Currently Zipkin B3 Propagation is supported for HTTP and GRPC.

middleware

The middleware subpackages contain officially supported middleware handlers and tracing wrappers.

http

An easy to use http.Handler middleware for tracing server side requests is provided. This allows one to use this middleware in applications using standard library servers as well as most available higher level frameworks. Some frameworks will have their own instrumentation and middleware that maps better for their ecosystem.

For HTTP client operations NewTransport can return a http.RoundTripper implementation that can either wrap the standard http.Client's Transport or a custom provided one and add per request tracing. Since HTTP Requests can have one or multiple redirects it is advisable to always enclose HTTP Client calls with a Span either around the *http.Client call level or parent function level.

For convenience NewClient is provided which returns a HTTP Client which embeds *http.Client and provides an application span around the HTTP calls when calling the DoWithAppSpan() method.

grpc

Easy to use grpc.StatsHandler middleware are provided for tracing gRPC server and client requests.

For a server, pass NewServerHandler when calling NewServer, e.g.,

import (
    "google.golang.org/grpc"
    zipkingrpc "github.com/openzipkin/zipkin-go/middleware/grpc"
)

server = grpc.NewServer(grpc.StatsHandler(zipkingrpc.NewServerHandler(tracer)))

For a client, pass NewClientHandler when calling Dial, e.g.,

import (
    "google.golang.org/grpc"
    zipkingrpc "github.com/openzipkin/zipkin-go/middleware/grpc"
)

conn, err = grpc.Dial(addr, grpc.WithStatsHandler(zipkingrpc.NewClientHandler(tracer)))

reporter

The reporter package holds the interface which the various Reporter implementations use. It is exported into its own package as it can be used by 3rd parties to use these Reporter packages in their own libraries for exporting to the Zipkin ecosystem. The zipkin-go tracer also uses the interface to accept 3rd party Reporter implementations.

HTTP Reporter

Most common Reporter type used by Zipkin users transporting Spans to the Zipkin server using JSON over HTTP. The reporter holds a buffer and reports to the backend asynchronously.

Kafka Reporter

High performance Reporter transporting Spans to the Zipkin server using a Kafka Producer digesting JSON V2 Spans. The reporter uses the Sarama async producer underneath.

usage and examples

HTTP Server Example


Download Details:

Author: Openzipkin
Source Code: https://github.com/openzipkin/zipkin-go 
License: Apache-2.0 license

#go #golang #traces #distribution 

Fannie  Zemlak

Fannie Zemlak

1599854400

What's new in the go 1.15

Go announced Go 1.15 version on 11 Aug 2020. Highlighted updates and features include Substantial improvements to the Go linker, Improved allocation for small objects at high core counts, X.509 CommonName deprecation, GOPROXY supports skipping proxies that return errors, New embedded tzdata package, Several Core Library improvements and more.

As Go promise for maintaining backward compatibility. After upgrading to the latest Go 1.15 version, almost all existing Golang applications or programs continue to compile and run as older Golang version.

#go #golang #go 1.15 #go features #go improvement #go package #go new features

Carmen  Grimes

Carmen Grimes

1595498460

Contact Tracing App: The Technology, Approach to fight COVID-19/Corona

As COVID-19 staggeringly lands blows to nations across the world, governments are considering ways to see their citizens through this pandemic. At the moment, a WHO situation report clocks the number of confirmed cases above two million along with more than one hundred thousand deaths. With vaccines dubbed as the best possible chance to tackle COVID-19 having no precise time frame of being ready, the talk is quickly shifting away to Contact Tracing Applications.

Contact tracing apps are digital solutions that use mobile technology to power the process of manual contact tracing. The apps follow a user’s movement, either by the use of Bluetooth technology, QR codes, or geo-location data while also tracking and keeping data from other user phones nearby. If one user gets diagnosed, the apps alert other users that they may have been exposed to the virus. As such, Contact Tracing Applications are being welcomed and perceived as an important approach to stem the spread of COVID-19 by providing a more accurate platform with data and information about affected individuals.

How Contact Tracing App Works

contact-tracing-app-devathon-

As mentioned above, contact tracing apps leverage mobile technology to trace cases of possible infection more accurately. But how exactly? Once installed and operative, the phone runs the app simultaneously with Bluetooth or location data to transmit signals with unique keys or IDs to phones in the designated range of connection. Similarly, the other phones with the app installed to detect and send back the signals.

For instance, if ‘Individual A’ has the app installed and goes outdoors to run some errands, they will interact with other individuals. In such a case, supposing all the other individuals had functional Contact Tracing Apps, each phone would exchange and store the contact data anonymously. It is important to note that the data collected only covers the app range distance to disregard irrelevant contacts and that their keys repeatedly change as individuals move. In any event that ‘Individual A’ tests positive for COVID-19 through confirmed tests, users who were previously within the proximity of ‘Individual A’ are alerted. Consequently, they are notified to check for symptoms, self-isolate, or get tested. Each time a person tests positive, the app notifies and advises the affected individuals.

In a nutshell, Contact Tracing Apps automate and supplement the traditional concept of tracing contacts to achieve extensive and realistic results in the least time possible.

What are the Benefits of Contact Tracing Apps?

Contract Tracing Apps are assets that offer indispensable solutions to health institutions and the public against COVID-19. There are several reasons why many governments are urging their citizens to use digital contact tracing apps to combat the spread of COVID-19. They include:

  1. The apps are more effective than manual tracing. While not perfect, their predictive algorithms frequently observe individuals detect new cases and analyze the probability one was infected. If one has contact with an asymptomatic individual, they are immediately notified and advised accordingly. Therefore, this saves time, energy, and resources that would have otherwise been overused.
  2. Contact tracing apps facilitate the relaxation of imposed restrictions or lockdowns. With a large number of infected people identified by the apps and put under surveillance, healthy citizens can be allowed to go about their duties. This may be a significant turning point to try and revive economies.
  3. Users’ private data is encrypted and secured. Even if you test positive, other users will only get notifications of possible infections. Your information is protected from both other users and developers of the app.
  4. They will increase the capacity to test and detect COVID-19 cases. With infected users alert, users who come in contact with affected persons come forward to be tested and treated with a higher recovery chance.

Future of Contact Tracing Apps?

Currently, the role of contact tracing apps is limited to accurately identifying infected individuals and their contacts as well as facilitating a quicker response to the Covid-19 threat.

Beyond that, the use of contact tracing apps is projected to take a different turn. One key area bound to change is how people’s privacy is handled. Tech institutions are under growing pressure to devise ways to develop privacy-preserving Contact Tracing Apps.

This will earn the users-trust, which is a pillar for these apps to help contain the disease. Technically, the technology will also have to improve drastically. The apps will have to seamlessly integrate with the user’s phone lifestyle causing minimal or no interference. With most applications having an open-source code, Artificial Intelligence, Beacon Technology, and Big Data solutions will be increasingly harnessed to power and improve them. The apps may also cut across various types of industries apart from health institutions.

How Can It Help to Trace COVID-19 and Reduce the Spread of the Virus?

contact-tracing-app-devathon-3

Contact Tracing Apps will effectively help stem lowering the cases of COVID-19. By using the apps, officials are able to monitor high-risk individuals easily. Also, should any new case arise, both users and health officials get notified they will swiftly act to trace, test, or isolate infected individuals.

Unlike traditional contact tracing, which may not get all contacts, these apps ensure that once Covid-19 cases are detected, they are all treated early, and those other individuals are not exposed to the infection. They also ward off users from high-risk areas. In the long run, they help break the COVID-19 chain by preventing further spread. Illustratively, an online publication by  CNBC states that more than 500,000 using a Singapore-registered mobile number downloaded the TraceTogether app within the first 24 hours of its launch. Subsequently, together with other government efforts, Singapore has since lowered the infection rate and eased restrictions.

If Contact Tracing Apps are implemented and used alongside other policies, we may as well be a few steps way to curbing this virus.

#android app #ios app #mobile app development #news #technology #contact tracing #contact tracing app #contact tracing app approach #contact tracing app technology #contact tracing coronavirus #contact tracing process #corona virus detecting app #corona virus tracing app #corona virus tracker #corona virus tracker live

Top 8 Machine Learning Libraries In Go Language One Must Know

Created by Google researchers, Go is a popular open-source programming language. The language includes many intuitive features, including a garbage collector, cross-platform, efficient concurrency, among others.

According to the Stack Overflow Developer Survey 2020, Go language is not only the fifth most loved programming language but also fetches the programmers the third-highest salary among other languages.

Below here, we list down the top machine learning libraries in Go language.

#opinions #go language #google ml tools #machine learning libraries #ml libraries #ml libraries in go

Nigel  Uys

Nigel Uys

1652703480

Go-trending: Go Library for Accessing Trending Repositories

go-trending

A package to retrieve trending repositories and developers from Github written in Go.

trending package showcase

Features

  • Get trending repositories
  • Get trending developers
  • Get all programming languages known by GitHub
  • Filtering by time and (programming) language
  • Support for GitHub Enterprise

Installation

It is go gettable

$ go get github.com/andygrunwald/go-trending

or using/updating to the latest master

$ go get -u github.com/andygrunwald/go-trending@master

API

Please have a look at the package documentation for a detailed API description.

Examples

A few examples how the API can be used. More examples are available in the GoDoc examples section.

List trending repositories of today for all languages

package main

import (
    "fmt"

    "github.com/andygrunwald/go-trending"
)

func main() {
    trend := trending.NewTrending()

    // Show projects of today
    projects, err := trend.GetProjects(trending.TimeToday, "")
    if err != nil {
        panic(err)
    }

    for index, project := range projects {
        i := index + 1
        if len(project.Language) > 0 {
            fmt.Printf("%d: %s (written in %s with %d ★ )\n", i, project.Name, project.Language, project.Stars)
        } else {
            fmt.Printf("%d: %s (with %d ★ )\n", i, project.Name, project.Stars)
        }
    }
}

List trending repositories of this week for Go

package main

import (
    "fmt"

    "github.com/andygrunwald/go-trending"
)

func main() {
    trend := trending.NewTrending()

    // Show projects of today
    projects, err := trend.GetProjects(trending.TimeWeek, "go")
    if err != nil {
        panic(err)
    }

    for index, project := range projects {
        i := index + 1
        if len(project.Language) > 0 {
            fmt.Printf("%d: %s (written in %s with %d ★ )\n", i, project.Name, project.Language, project.Stars)
        } else {
            fmt.Printf("%d: %s (with %d ★ )\n", i, project.Name, project.Stars)
        }
    }
}

List trending developers of this month for Swift

package main

import (
    "fmt"

    "github.com/andygrunwald/go-trending"
)

func main() {
    trend := trending.NewTrending()

    developers, err := trend.GetDevelopers(trending.TimeMonth, "swift")
    if err != nil {
        panic(err)
    }

    for index, developer := range developers {
        i := index + 1
        fmt.Printf("%d: %s (%s)\n", i, developer.DisplayName, developer.FullName)
    }
}

List available languages

package main

import (
    "fmt"

    "github.com/andygrunwald/go-trending"
)

func main() {
    trend := trending.NewTrending()

    // Show languages
    languages, err := trend.GetLanguages()
    if err != nil {
        panic(err)
    }

    for index, language := range languages {
        i := index + 1
        fmt.Printf("%d: %s (%s)\n", i, language.Name, language.URLName)
    }
}

Inspired by

Author: Andygrunwald
Source Code: https://github.com/andygrunwald/go-trending 
License: MIT license

#go #golang #hacktoberfest #library