海外TECH |
Ars Technica |
Amazon is discontinuing its AmazonSmile charity program next month |
https://arstechnica.com/?p=1911172
|
charities |
2023-01-19 18:29:31 |
海外TECH |
Ars Technica |
The first “Bored Ape” NFT game costs $2,300+ for three weeks of play |
https://arstechnica.com/?p=1911184
|
frenzy |
2023-01-19 18:21:01 |
海外TECH |
MakeUseOf |
How to Tag Someone on Facebook: 3 Different Ways |
https://www.makeuseof.com/tag/3-important-ways-tag-someone-facebook/
|
status |
2023-01-19 18:16:15 |
海外TECH |
MakeUseOf |
How to Solve the "WslRegisterDistribution Failed With Error 0x80370102" Issue in Windows |
https://www.makeuseof.com/wslregisterdistribution-failed-with-error-0x80370102-windows/
|
windows |
2023-01-19 18:16:15 |
海外TECH |
DEV Community |
Observability-driven development with Go and Tracetest |
https://dev.to/kubeshop/observability-driven-development-with-go-and-tracetest-88d
|
Observability driven development with Go and TracetestWe re entering a new era of observability driven development ODD uses OpenTelemetry instrumentation as assertions in tests Here s an awesome explanation on Twitter This is driving a new culture of trace based testing With trace based testing you can generate integration tests from OpenTelemetry based traces enforce quality encourage velocity and increase test coverage in microservices and distributed apps Today you ll learn to build a distributed system with Go and Docker You ll instrument it with OpenTelemetry traces and use Tracetest to run trace based tests on top of OpenTelemetry infrastructure We ll follow observability driven development principles and showcase why it s powerful in today s world of developing distributed systems in the cloud By the end of this tutorial you ll learn observability driven development how to develop microservices with Go and how to run trace based tests with Tracetest To check out the entire code jump over to GitHub What are we building The distributed app we re building will have two microservices and a dedicated module for OpenTelemetry trace instrumentation We ll use Go to write the code and Docker Compose to deploy the microservices The app itself is a bookstore that shows books with their price and availability We will follow observability driven development best practices of first writing a test then writing the code and adding OpenTelemetry instrumentation to validate the test spec and finally run trace based tests with Tracetest and make sure they pass The tutorial consists of parts The first part will be dedicated to configuring the basic bookstore infrastructure and books service setting up OpenTelemetry instrumentation and installing Tracetest In the second part we will focus on running ODD tests hands on and creating trace based tests for the books service The third and final part will focus on creating the availability service and covering it with tests Before we begin let s quickly explain what OpenTelemetry and Tracetest are What is OpenTelemetry OpenTelemetry is an observability framework that assist in generating and capturing telemetry data from cloud native software OpenTelemetry gathers observability data including traces metrics and logs OpenTelemetry is a community driven open source project and as of August is a CNCF incubating project OpenTelemetry is the second most active CNCF project behind Kubernetes These are the three components we ll use in this guide OpenTelemetry Go APIs and SDKs for generating and emitting telemetryOpenTelemetry Collector to receive process and export telemetry dataOTLP protocol for transmitting telemetry dataBecause OpenTelemetry is a framework you need a data store to persist traces We ll demo how to use Jaeger as the trace data store and the OpenTelemetry Collector as the gateway to funnel traces to Jaeger for storage What is Tracetest Tracetest uses your existing OpenTelemetry traces to power trace based testing with assertions against your trace data at every point of the request transaction You ll point Tracetest to the existing Jaeger trace data source Tracetest will then pull traces from Jaeger while running integration tests to run assertions against the trace data itself There is an option to bypass using a trace data store entirely and send traces to Tracetest right away by configuring the OpenTelemetry collector as explained in our docs With that we re ready to start coding Setting up the infrastructure for observability driven developmentThis section will explain the initial configuration of both the bookstore app and Tracetest We ll use Docker Compose for the infrastructure Once done you ll have a running app with Tracetest configured for running tests Installing Tracetest for local developmentYou can follow the sample code we ve prepared for part of this tutorial Follow the instructions below git clone git github com kubeshop tracetest gitcd examples observability driven development go tracetest bookstore partdocker compose f docker compose yaml f tracetest docker compose yaml upNote View the st part of our observability driven development video tutorial here Let s walk through the installation step by step Start by installing the Tracetest CLI It s the easiest way of getting started with Tracetest brew install kubeshop tracetest tracetestNote Follow this guide to install for your specific operating system Once the CLI is installed create a directory called bookstore and install a Tracetest server tracetest server installFollow the prompts and install a bare bones setup with just Tracetest This will generate an empty docker compose yaml file and a tracetest directory that contains another docker compose yaml Configuring OpenTelemetry Collector and Jaeger with TracetestLet s edit the docker compose yaml to add OpenTelemetry Collector and Jaeger tracetest docker compose yamlservices jaeger healthcheck test CMD wget spider localhost timeout s interval s retries image jaegertracing all in one latest networks default null restart unless stopped otel collector command config otel local config yaml depends on jaeger condition service started image otel opentelemetry collector networks default null volumes type bind source tracetest otel collector yaml target otel local config yaml bind create host path true postgres environment POSTGRES PASSWORD postgres POSTGRES USER postgres healthcheck test CMD SHELL pg isready U POSTGRES USER d POSTGRES DB timeout s interval s retries image postgres networks default null tracetest depends on otel collector condition service started postgres condition service healthy extra hosts host docker internal host gateway healthcheck test CMD wget spider localhost timeout s interval s retries image kubeshop tracetest v networks default null ports mode ingress target published protocol tcp volumes type bind source tracetest tracetest yaml target app config yamlnetworks default name defaultLet me explain what s going on in the docker compose yaml file We hook up the OpenTelemetry Collector to act as a gateway for all the traces our app will generate and Jaeger as a trace data store The OpenTelemetry Collector will receive all traces from our Go microservices and send them to Jaeger We will then configure Tracetest to fetch trace data from Jaeger when running trace based tests Make sure your config files for Tracetest and the OpenTelemetry Collector match the sample code First copy paste this into your otel collector yaml tracetest otel collector yamlexporters jaeger endpoint jaeger tls insecure trueprocessors batch timeout msreceivers otlp protocols grpc null http nullservice pipelines traces exporters jaeger processors batch receivers otlpNow from the bookstore directory start Docker Compose to test the Tracetest installation docker compose f docker compose yaml f tracetest docker compose yaml upThis command will spin up the infrastructure and expose Tracetest on port Open up http localhost in your browser Configure your trace data store to point to Jaeger in the Web UI You can also configure Jaeger via the CLI Adding the books microserviceIn the bookstore directory create a books directory and initialize a Go module cd booksgo mod init github com your username bookstore booksIn the books directory create a main go file Paste this code into the main go books main gopackage mainimport context fmt io log net http time github com gorilla mux go opentelemetry io contrib instrumentation github com gorilla mux otelmux go opentelemetry io otel go opentelemetry io otel exporters otlp otlptrace otlptracegrpc go opentelemetry io otel propagation go opentelemetry io otel sdk resource sdktrace go opentelemetry io otel sdk trace semconv go opentelemetry io otel semconv v go opentelemetry io otel trace google golang org grpc google golang org grpc credentials insecure const svcName books var tracer trace Tracerfunc newExporter ctx context Context sdktrace SpanExporter error ctx cancel context WithTimeout ctx time Second defer cancel conn err grpc DialContext ctx otel collector grpc WithTransportCredentials insecure NewCredentials grpc WithBlock if err nil return nil fmt Errorf failed to create gRPC connection to collector w err traceExporter err otlptracegrpc New ctx otlptracegrpc WithGRPCConn conn if err nil return nil fmt Errorf failed to create trace exporter w err return traceExporter nil func newTraceProvider exp sdktrace SpanExporter sdktrace TracerProvider Ensure default SDK resources and the required service name are set r err resource Merge resource Default resource NewWithAttributes semconv SchemaURL semconv ServiceNameKey String svcName if err nil panic err tp sdktrace NewTracerProvider sdktrace WithBatcher exp sdktrace WithResource r otel SetTextMapPropagator propagation NewCompositeTextMapPropagator propagation TraceContext propagation Baggage return tp func main ctx context Background exp err newExporter ctx if err nil log Fatalf failed to initialize exporter v err Create a new tracer provider with a batch span processor and the given exporter tp newTraceProvider exp Handle shutdown properly so nothing leaks defer func tp Shutdown ctx otel SetTracerProvider tp Finally set the tracer that can be used for this package tracer tp Tracer svcName r mux NewRouter r Use otelmux Middleware svcName r HandleFunc books booksListHandler http Handle r log Fatal http ListenAndServe nil func booksListHandler w http ResponseWriter r http Request span tracer Start r Context Books List defer span End io WriteString w Hello n Let s walk through what s happening in the books main go file The newExporter function is defining how to export trace data and to forward it to the OpenTelemetry Collector we have running on otel collector The newTraceProvider function is initializing the tracer that we use to instrument the code The main function is initializing everything and defines an HTTP route called books to trigger a booksListHandler The booksListHandler function will return a simple Hello string It also starts the OpenTelemetry tracer and defines a span called Books List With all this added fetch Go dependencies by running this command in the terminal from the books directory go mod tidyThis will generate a go sum file Lastly add a books service to the docker compose yaml file in the bookstore directory This is the root docker compose yaml file not the one inside the tracetest directory docker compose yamlservices books image your username books build args SERVICE books ports depends on otel collector condition service startedNext create a Dockerfile and paste this code into it DockerfileFROM golang ARG SERVICEWORKDIR app SERVICE COPY SERVICE go app SERVICE RUN go mod downloadCOPY SERVICE app SERVICE RUN go build o app server ENTRYPOINT app server Finally restart Docker Compose to try out the books service docker compose f docker compose yaml f tracetest docker compose yaml up Running a trace based test in the Tracetest web UIWith the Tracetest service running on port open it up on http localhost in your browser Create a new HTTP test Give it a name and make sure to set the URL to http books books Click create This will trigger the test to run right away The test will return a status code Next we need to add assertions against the trace data to make sure our OpenTelemetry tracing instrumentation works in our Go code Open the Trace tab and let s start by adding a status code assertion Click on the Tracetest trigger span In the left navigation select tracetest response status and click Create test spec If you re writing the assertion by hand make sure to preface the attribute with a attr to enable autocompletion when selecting what attribute to assert on Save the test spec and add another assertion to the Books list span This time add the attribute called attr tracetest selected spans count Save and publish the test specs Re run the test You now have passing tests that ensure the service responds with a status code and verifies the OpenTelemetry manual code instrumentation works Running a trace based test with the Tracetest CLILet s re trace no pun intended our steps with the Tracetest CLI Create an ee directory in the bookstore directory Create a file called books list yaml This will contain a test definition we will trigger with the CLI Paste this code into the books list yaml ee books list yamltype Testspec id khEWUR name Books Listing description Try books service trigger type http httpRequest url http books books method GET headers key Content Type value application json specs selector span name Tracetest trigger assertions attr tracetest response status selector span name Books List assertions attr tracetest selected spans count Take a moment to read the code You see the assertions match what we just added in the Tracetest Web UI To trigger the test from the command line first configure the Tracetest CLI Make sure to point the CLI to the URL where the Tracetest service is running In this sample it s http localhost tracetest configure Output Enter your Tracetest server URL http localhost http localhost Output Enable analytics Y n YesNow we can run the test From the bookstore dir run tracetest test run d ee books list yaml w Output Books Listing http localhost test khEWUR run test Clicking the link will open the test run in the Web UI With the initial setup done we re ready to move on and tackle getting hands on with observability driven development Hands on observability driven developmentTo follow along you can check out the sample code we ve prepared for part Follow the instructions below git clone git github com kubeshop tracetest gitcd examples observability driven development go tracetest bookstore partdocker compose f docker compose yaml f tracetest docker compose yaml up tracetest test run d ee books list yaml wNote View the nd part of our observability driven development video tutorial here To get started let s first add more detailed assertions to the books list yaml and make our test fail Open the books list yaml file and add a custom attribute called attr books list count This means we are expecting the Books List API test to return books ee books list yaml specs selector span name Tracetest trigger assertions attr tracetest response status selector span name Books List assertions attr tracetest selected spans count attr books list count Jump back into the terminal and run the test again tracetest test run d ee books list yaml w Output ✘Books Listing http localhost test khEWUR run test span name Tracetest trigger ebaefecbf attr tracetest response status ✘span name Books List ✘ fcfaaaaa attr tracetest selected spans count ✘attr books list count http localhost test khEWUR run test selectedAssertion amp selectedSpan fcfaaaaa The Books List span now fails the test In true ODD fashion let s add the code to satisfy the test spec We need to add a getBooks function to retrieve the books and make sure to add OpenTelemetry instrumentation to validate that it is indeed returning the books in the form of an array Open up the books main go file We will edit the booksListHandler function and add a getBooks function that simulates getting books from a database books main go func booksListHandler w http ResponseWriter r http Request ctx span tracer Start r Context Books List defer span End books err getBooks ctx if err nil w WriteHeader http StatusInternalServerError io WriteString w cannot read books DB return This is how we instrument the code with OpenTelemetry This is the attribute we run the assertion against span SetAttributes attribute Int books list count len books jsonBooks err json Marshal books if err nil w WriteHeader http StatusInternalServerError io WriteString w cannot json encode books DB return w Write jsonBooks type book struct ID string json id Name string json name Price int json price Mocking a database requestfunc getBooks ctx context Context book error return book Harry Potter Foundation Moby Dick nil Save the changes and restart Docker Compose Now run the same test tracetest test run d ee books list yaml w Output Books Listing http localhost test khEWUR run test The test passes Clicking the link in the test will open up the Tracetest Web UI We re starting to look like ODD pros right now But we re not done yet We want to add an availability check to our bookstore What if a book is not in stock We need to be able to check that Setting up observability driven tests for multiple microservicesTo follow along you can check out the sample code we ve prepared for part Follow the instructions below git clone git github com kubeshop tracetest gitcd examples observability driven development go tracetest bookstore partdocker compose f docker compose yaml f tracetest docker compose yaml up tracetest test run d ee books list yaml wFirst add another book entry to the getBooks function We ll add an availability check that will confirm it is out of stock books main go func getBooks ctx context Context book error return book Harry Potter Foundation Moby Dick The art of war Add this book nil Once again open up the books list yaml Let s add assertions for the availability books list yaml specs selector span name Tracetest trigger assertions attr tracetest response status selector span name Books List assertions attr tracetest selected spans count attr books list count This selector will look for a descendant of the Books List span called Availability Check selector span name Books List span name Availability Check assertions attr tracetest selected spans count We want to make sure that an availability check is performed for every single book from the getBooks function Re running the test will cause it to fail because of the availability check as expected tracetest test run d ee books list yaml w Output ✘Books Listing http localhost test khEWUR run test span name Tracetest trigger bcbe attr tracetest response status span name Books List fcfed attr tracetest selected spans count attr books list count ✘span name Books List span name Availability Check ✘ meta ✘attr tracetest selected spans count http localhost test khEWUR run test selectedAssertion Next let s write the code to send an HTTP request to an availability microservice books main go func httpError span trace Span w http ResponseWriter msg string err error w WriteHeader http StatusInternalServerError io WriteString w msg span RecordError err span SetStatus codes Error msg func booksListHandler w http ResponseWriter r http Request ctx span tracer Start r Context Books List defer span End books err getAvailableBooks ctx if err nil httpError span w cannot read books DB err return span SetAttributes attribute Int books list count len books jsonBooks err json Marshal books if err nil httpError span w cannot json encode books err return w Write jsonBooks func getAvailableBooks ctx context Context book error books err getBooks ctx if err nil return nil err availableBook make book len books for book range books available err isBookAvailable ctx book ID if err nil return nil err if available continue availableBook append availableBook book return availableBook nil var httpClient amp http Client Transport otelhttp NewTransport http DefaultTransport func isBookAvailable ctx context Context bookID string bool error ctx span tracer Start ctx Availability Request trace WithAttributes attribute String bookID bookID defer span End url http availability bookID req http NewRequestWithContext ctx http MethodGet url nil resp err httpClient Do req if err nil span RecordError err span SetStatus codes Error cannot do request return false err if resp StatusCode http StatusNotFound span SetStatus codes Error not found return false nil stockBytes err io ReadAll resp Body if err nil span RecordError err span SetStatus codes Error cannot read response body return false err stock err strconv Atoi string stockBytes if err nil span RecordError err span SetStatus codes Error cannot parse stock value return false err return stock gt nil Let me explain the code in detail We re adding a isBookAvailable function that checks if a book is available based on a provided bookID It calls the http availability endpoint and appends a bookID value The isBookAvailable function is then used in the getAvailableBooks function that iterates through the books from the getBooks function The booksListHandler function now calls the getAvailableBooks function instead of calling getBooks The httpError is just a helper function Note Do not forget to re run go mod tidy if you change code that requires modules to be downloaded Make sure to also restart Docker Compose after editing code Let s re run the test tracetest test run d ee books list yaml w Output ✘Books Listing http localhost test qasYcUR run test ✘span name Tracetest trigger ✘ fbcfb ✘attr tracetest response status http localhost test qasYcUR run test selectedAssertion amp selectedSpan fbcfb ✘span name Books List ✘ fefdc attr tracetest selected spans count ✘attr books list count http localhost test qasYcUR run test selectedAssertion amp selectedSpan fefdc ✘span name Books List span name Availability Check ✘ meta ✘attr tracetest selected spans count http localhost test qasYcUR run test selectedAssertion We re getting a different error now The response status of the Tracetest trigger span equals Hmm not great right Wrong We re on the correct path The test is failing because we added code that sends an HTTP request to an availability service that does not exist Let s fix that Next up creating an availability service Trace based testing across multiple servicesTo follow along you can check out the sample code we ve prepared for part Follow the instructions below git clone git github com kubeshop tracetest gitcd examples observability driven development go tracetest bookstore partdocker compose f docker compose yaml f tracetest docker compose yaml up tracetest test run d ee books list yaml wNote View the rd part of our observability driven development video tutorial here When developing distributed apps and microservices it s best practice to extract the OpenTelemetry instrumentation to a dedicated module This will let you import the OpenTelemetry configuration into all of your microservices without duplicating code Let s start with pulling out the OpenTelemetry SDKs from the books main go and putting them in a dedicated file called instrumentation go Create a lib directory in the root of the bookstore directory Initialize a module with cd libgo mod init github com your username bookstore libNote File paths can be tricky in Go Makes sure the name of the file path matches the location on GitHub when you import the module in your microservices Once you create the Go module create another directory called instrumentation Add a single file called instrumentation go Remove the OpenTelemetry instrumentation code from books main go and add i to the lib instrumentation instrumentation go lib instrumentation instrumentation go package instrumentationimport context fmt time go opentelemetry io otel go opentelemetry io otel exporters otlp otlptrace otlptracegrpc go opentelemetry io otel propagation go opentelemetry io otel sdk resource sdktrace go opentelemetry io otel sdk trace semconv go opentelemetry io otel semconv v google golang org grpc google golang org grpc credentials insecure func NewExporter ctx context Context sdktrace SpanExporter error ctx cancel context WithTimeout ctx time Second defer cancel conn err grpc DialContext ctx otel collector grpc WithTransportCredentials insecure NewCredentials grpc WithBlock if err nil return nil fmt Errorf failed to create gRPC connection to collector w err traceExporter err otlptracegrpc New ctx otlptracegrpc WithGRPCConn conn if err nil return nil fmt Errorf failed to create trace exporter w err return traceExporter nil func NewTraceProvider svcName string exp sdktrace SpanExporter sdktrace TracerProvider Ensure default SDK resources and the required service name are set r err resource Merge resource Default resource NewWithAttributes semconv SchemaURL semconv ServiceNameKey String svcName if err nil panic err tp sdktrace NewTracerProvider sdktrace WithBatcher exp sdktrace WithResource r otel SetTextMapPropagator propagation NewCompositeTextMapPropagator propagation TraceContext propagation Baggage return tp Don t forget to run go mod tidy in the terminal from the lib folder to make sure the dependencies are downloaded and saved You can now safely commit and push this code to GitHub This will let you download it and use it in both the books and availability microservices Lets move on to updating the books service first books main gopackage mainimport context encoding json io log net http strconv github com gorilla mux Add the instrumentation module from lib Make sure to first push the module to GitHub Watch out to get the directory tree and name to match github com your username bookstore lib instrumentation go opentelemetry io contrib instrumentation github com gorilla mux otelmux go opentelemetry io contrib instrumentation net http otelhttp go opentelemetry io otel go opentelemetry io otel attribute go opentelemetry io otel codes go opentelemetry io otel trace const svcName books var tracer trace Tracerfunc main ctx context Background Calling the instrumentation module exp err instrumentation NewExporter ctx if err nil log Fatalf failed to initialize exporter v err Calling the instrumentation module Create a new tracer provider with a batch span processor and the given exporter tp instrumentation NewTraceProvider svcName exp Handle shutdown properly so nothing leaks defer func tp Shutdown ctx otel SetTracerProvider tp Finally set the tracer that can be used for this package tracer tp Tracer svcName r mux NewRouter r Use otelmux Middleware svcName r HandleFunc books booksListHandler http Handle r log Fatal http ListenAndServe nil The books main go looks exactly the same except for removing the OpenTelemetry instrumentation code and importing the lib instrumentation module instead Make sure to edit the import to use the instrumentation module you pushed to GitHub Then we use the instrumentation object to call the NewExporter and NewTraceProvider methods To make sure the behavior is the same after this change let s restart Docker Compose and re run the same test as above tracetest test run d ee books list yaml w Output ✘Books Listing http localhost test qasYcUR run test ✘span name Tracetest trigger ✘ eaf ✘attr tracetest response status http localhost test qasYcUR run test selectedAssertion amp selectedSpan eaf ✘span name Books List ✘ fdfede attr tracetest selected spans count ✘attr books list count http localhost test qasYcUR run test selectedAssertion amp selectedSpan fdfede ✘span name Books List span name Availability Check ✘ meta ✘attr tracetest selected spans count http localhost test qasYcUR run test selectedAssertion Awesome We re getting the same issue as before Wild isn t it I m cheering because we re getting the same issue as before With that out of the way time to build our availability service Hands on observability driven tests across multiple microservicesCheck out the sample code we ve prepared for part to follow along Follow the instructions below git clone git github com kubeshop tracetest gitcd examples observability driven development go tracetest bookstore partdocker compose f docker compose yaml f tracetest docker compose yaml up tracetest test run d ee books list yaml wTo begin we need a new directory for our additional microservice Create an availability directory in the bookstore directory Initialize a Go module cd availabilitygo mod init github com your username bookstore availabilityCreate a file called availability main go Paste this code into it package mainimport context io log net http Make sure this module matches the lib instrumentation module from the previous section github com your username bookstore lib instrumentation github com gorilla mux go opentelemetry io contrib instrumentation github com gorilla mux otelmux go opentelemetry io otel go opentelemetry io otel attribute go opentelemetry io otel codes go opentelemetry io otel trace const svcName availability var tracer trace Tracerfunc main ctx context Background exp err instrumentation NewExporter ctx if err nil log Fatalf failed to initialize exporter v err Create a new tracer provider with a batch span processor and the given exporter tp instrumentation NewTraceProvider svcName exp Handle shutdown properly so nothing leaks defer func tp Shutdown ctx otel SetTracerProvider tp Finally set the tracer that can be used for this package tracer tp Tracer svcName r mux NewRouter r Use otelmux Middleware svcName r HandleFunc bookID stockHandler http Handle r log Fatal http ListenAndServe nil var books map string string func stockHandler w http ResponseWriter r http Request span tracer Start r Context Availability Check defer span End vars mux Vars r bookID ok vars bookID if ok span SetStatus codes Error no bookID in URL w WriteHeader http StatusBadRequest io WriteString w missing bookID in URL return The span we will run an assertion against span SetAttributes attribute String bookID bookID stock ok books bookID if ok span SetStatus codes Error book not found w WriteHeader http StatusNotFound io WriteString w book not found return w WriteHeader http StatusOK io WriteString w stock As always run go mod tidy to generate a go sum file and download modules Let me explain the code We are using the NewExporter and NewTraceProvider in the main function just as we did in the books main go We are running an HTTP server on port that expects a bookID as a parameter The HTTP route bookID will trigger a stockHandler function This function checks if the book is in stock or not Wonderful With the availability service added we need to add it to the docker compose yaml as well services books image your username books build args SERVICE books ports depends on otel collector availability image your username availability build args SERVICE availability depends on otel collectorThe availability service will use the same Dockerfile as the books service That s all We re done Let s restart Docker Compose and see if the Books Listing test passes For reference here s the full ee books list yaml test file we re running ee books list yamltype Testspec id qasYcUR name Books Listing description Try books service trigger type http httpRequest url http books books method GET headers key Content Type value application json specs selector span name Tracetest trigger assertions attr tracetest response status selector span name Books List assertions attr tracetest selected spans count attr books list count selector span name Books List span name Availability Check assertions attr tracetest selected spans count In your terminal run tracetest test run d ee books list yaml w Output Books Listing http localhost test qasYcUR run test Clicking the link will open the Tracetest Web UI and show the assertions in detail We can clearly see how an availability check was triggered four times One time for every book in the list ConclusionYou ve learned how to practice observability driven development with Go and Tracetest across multiple microservices by using a dedicated OpenTelemetry instrumentation module Well done To continue learning about observability driven development check out our part video tutorial about observability driven development with Go and Tracetest Give Tracetest a try in your own applications and tracing infrastructure by following either our quick start guide which sets you up with the CLI tooling and the Tracetest server in a few steps or our detailed guide for more details Feel free to give us a star on GitHub as well By practicing observability driven development and trace based testing best practices we want you to have a more developer friendly experience by increasing your test coverage freeing yourself from manual testing procedures and identifying bottlenecks you didn t even know existed We d love to hear about your ODD success stories in Discord We truly value your feedback so don t be shy |
2023-01-19 18:41:24 |
海外TECH |
Engadget |
Sony confirms 13 more PS VR2 games, including ‘Tetris Effect' and ‘Rez Infinite’ |
https://www.engadget.com/ps-vr2-launch-lineup-tetris-effect-rez-infinite-thumper-181041930.html?src=rss
|
Sony confirms more PS VR games including Tetris Effect x and Rez Infinite Sony will start shipping PS VR in little over a month and it has revealed more details about games coming to the platform as well as the launch lineup The company has confirmed additional titles for PS VR all of which are already available on PS VR or other platforms Tetris Effect Connected Rez Infinite nbsp and Thumper nbsp are among the original PS VR titles that will hit the new headset Those who already own Tetris Effect or Rez Infinite for PS and PS VR will be able to upgrade to the PS they re playable without the headset and PS VR version for ーPS VR versions aren t compatible with the new hardware In Rez Infinite you ll be able to track and aim at enemies using your eyes PS VR s eye tracking will also be at the forefront in Before Your Eyes a game that advances time when you blink NFL Pro Era multiplayer shooter Pavlov VR the impressive looking Kayak VR Mirage and What The Bat from the folks behind What The Golf are also coming to PS VR If you own D jigsaw title Puzzling Places or rhythm game Synth Riders for PS VR you ll get a free upgrade Rounding out the latest announcements are Song in the Smoke Rekindled Creed Rise to Glory Championship Edition and The Last Clockwinder PS VR will arrive on February nd The base package which comes with Sense controllers and stereo headphones costs You ll also need a PS to use the headset Sony expects that more than titles will be available for the platform by the end of March including After the FallAltair BreakerBefore Your EyesCities VRCosmonious HighCreed Rise to Glory Championship EditionThe Dark Pictures SwitchbackDemeoDyschronia Chronos AlternateFantavision XGran Turismo free update to PS version Horizon Call of the Mountain Job SimulatorJurassic World AftermathKayak VR MirageKizuna AI Touch the Beat The Last ClockwinderThe Light Brigade purchase includes both PS VR and PS VR versions Moss amp Remaster NFL Pro Era free upgrade No Man s SkyPavlov VRPistol Whip free upgrade Puzzling Places free upgrade Resident Evil Village free update for the PS version Rez InfiniteSong in the SmokeStar Wars Tales from the Galaxy s Edge Synth Riders free upgrade The Tale of OnogoroTentacularTetris Effect ConnectedThumperThe Walking Dead Saints amp Sinners Ch RetributionVacation SimulatorWhat the Bat Zenith The Last City free upgrade This list suggests you ll need to wait a while longer for the likes of Among Us VR Beat Saber and Ghostbusters Rise of the Ghost Lord There s still no word if or when Half Life Alyx is coming to PS VR unfortunately Meanwhile Polyphony revealed a few more details about the free PS VR update for Gran Turismo which should be available on launch day You ll be able to play almost the entire game including online races in virtual reality However you won t be able to enjoy splitscreen two player races while you have the headset on |
2023-01-19 18:10:41 |
Cisco |
Cisco Blog |
Passenger Experience in Rail |
https://blogs.cisco.com/transportation/passenger-experience-in-rail
|
Passenger Experience in RailAs ridership inches toward pre pandemic levels rail operators need to continue evolving their operations while searching for new ways to attract passengers and adapt to new transit behaviors Ensuring seamless secure connectivity from the station to the train is foundational for creating a modern passenger experience and developing new revenue services |
2023-01-19 18:55:01 |
海外科学 |
NYT > Science |
Unlocking the Genes That Made Whales Into Giants |
https://www.nytimes.com/2023/01/19/science/whale-gene-giant.html
|
whale |
2023-01-19 18:24:18 |
海外科学 |
NYT > Science |
A Fake Death in Romancelandia |
https://www.nytimes.com/2023/01/16/health/fake-death-romance-novelist-meachen.html
|
addiction |
2023-01-19 18:35:17 |
ニュース |
BBC News - Home |
Beth Matthews: Blogger who took poisonous substance failed by hospital |
https://www.bbc.co.uk/news/uk-england-manchester-64305822?at_medium=RSS&at_campaign=KARANGA
|
inquest |
2023-01-19 18:11:32 |
ニュース |
BBC News - Home |
Alec Baldwin to be charged with involuntary manslaughter over Rust shooting |
https://www.bbc.co.uk/news/world-us-canada-64337761?at_medium=RSS&at_campaign=KARANGA
|
halyna |
2023-01-19 18:23:30 |
ニュース |
BBC News - Home |
Rail workers given fresh pay offer in dispute |
https://www.bbc.co.uk/news/business-64336828?at_medium=RSS&at_campaign=KARANGA
|
workers |
2023-01-19 18:17:41 |
ニュース |
BBC News - Home |
Plymouth shootings: 'Not enough staff' to deal with gun licences |
https://www.bbc.co.uk/news/uk-england-devon-64336729?at_medium=RSS&at_campaign=KARANGA
|
plymouth |
2023-01-19 18:20:47 |
ニュース |
BBC News - Home |
Andy Murray wins Australian Open epic at 4am |
https://www.bbc.co.uk/sport/tennis/64333916?at_medium=RSS&at_campaign=KARANGA
|
Andy Murray wins Australian Open epic at amAndy Murray produces one of his best fightbacks from two sets down to beat Thanasi Kokkinakis in an epic Australian Open match finishing at local time |
2023-01-19 18:55:50 |
ニュース |
BBC News - Home |
Rishi Sunak sorry for removing seatbelt to film video |
https://www.bbc.co.uk/news/uk-politics-64337866?at_medium=RSS&at_campaign=KARANGA
|
media |
2023-01-19 18:36:12 |
ニュース |
BBC News - Home |
Ambulance waits: Mum drives daughter to hospital during seizure |
https://www.bbc.co.uk/news/uk-wales-64335312?at_medium=RSS&at_campaign=KARANGA
|
niamh |
2023-01-19 18:28:53 |
ニュース |
BBC News - Home |
Australian Open: Watch Andy Murray beat Thanasi Kokkinakis in five-set epic |
https://www.bbc.co.uk/sport/av/tennis/64340340?at_medium=RSS&at_campaign=KARANGA
|
Australian Open Watch Andy Murray beat Thanasi Kokkinakis in five set epicAndy Murray fights back from two sets down to beat Thanasi Kokkinakis at am local time to reach the third round of the Australian Open |
2023-01-19 18:48:35 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
頭のいい人は交渉前の準備が違う!5つの心構えで交渉の苦手意識は消える - 頭がいい人の交渉術 |
https://diamond.jp/articles/-/316038
|
頭のいい人は交渉前の準備が違うつの心構えで交渉の苦手意識は消える頭がいい人の交渉術前回は、相手にナメられたりすることなく、対等な人間関係を築くためには、交渉術を身に付けることが大事だとお話ししました。 |
2023-01-20 04:00:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「もしかして自分って嫌われている?」と思ったらチェックしてほしい“2つのこと” - 成功者がしている100の習慣 |
https://diamond.jp/articles/-/315917
|
人間関係 |
2023-01-20 04:00:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
アップル製ホワイトボードアプリ「フリーボード」、機能設計に見る目指す形 - ビジネスを変革するテクノロジー |
https://diamond.jp/articles/-/316398
|
アップル製ホワイトボードアプリ「フリーボード」、機能設計に見る目指す形ビジネスを変革するテクノロジーMacBookProやMacminiがMチップへのサイレントアップデートを果たすなど、AppleSiliconを搭載したハードウエアや、衛星通信を利用した緊急通報システムなどのサービス絡みで話題になることが多かった最近のアップル。 |
2023-01-20 03:57:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
麻生太郎氏また失言「出産女性の高齢化で少子化」、子育て世代に責任転嫁の絶望 - News&Analysis |
https://diamond.jp/articles/-/316346
|
newsampampanalysis |
2023-01-20 03:55:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
仕事で追い詰められたとき、まずやるべきこと - 仕事も人生もうまくいく整える力 |
https://diamond.jp/articles/-/315992
|
枡野俊明 |
2023-01-20 03:50:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
タブーに踏み込む異例の岸田批判、「無派閥」貫く菅前首相の思惑とは - 永田町ライヴ! |
https://diamond.jp/articles/-/316299
|
安全保障政策 |
2023-01-20 03:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
巨大ハイテク企業の運勢一転、厳しい1年に - WSJ PickUp |
https://diamond.jp/articles/-/316344
|
wsjpickup |
2023-01-20 03:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
米中摩擦「漁夫の利」のベトナム経済、22年は25年ぶり高成長も23年は減速 - 西濵徹の新興国スコープ |
https://diamond.jp/articles/-/316345
|
実質経済成長率 |
2023-01-20 03:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
2023年の商品市場 「慎重な楽観論」が主流に - WSJ PickUp |
https://diamond.jp/articles/-/316343
|
wsjpickup |
2023-01-20 03:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
岸田首相「異次元の少子化対策」は小手先?出産費用は抜本対策が必要だ - 知らないと損する!医療費の裏ワザと落とし穴 |
https://diamond.jp/articles/-/316355
|
出産育児一時金 |
2023-01-20 03:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
就活生必見!コロナ禍で外資よりJAL・ANAにアドバンテージ、「航空業界」の採用動向 - 親と子のための業界・企業研究2023 |
https://diamond.jp/articles/-/314812
|
企業研究 |
2023-01-20 03:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【英会話上達】 学歴はまったく関係ない…英会話力が爆上がりする人の共通点 - バカでも英語がペラペラ! 超★勉強法 |
https://diamond.jp/articles/-/314319
|
【英会話上達】学歴はまったく関係ない…英会話力が爆上がりする人の共通点バカでも英語がペラペラ超勉強法英語とは縁遠い新潟の片田舎で生まれ育ち、勉強はからっきし苦手。 |
2023-01-20 03:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【世界歴代興行収入No.1映画】の核心にもつながった科学者の「伝説のスピーチ」 - マザーツリー |
https://diamond.jp/articles/-/315806
|
【世界歴代興行収入No映画】の核心にもつながった科学者の「伝説のスピーチ」マザーツリー養老孟司氏、隈研吾氏、斎藤幸平氏らが絶賛している話題書『マザーツリー森に隠された「知性」をめぐる冒険』ー。 |
2023-01-20 03:05:00 |
GCP |
Cloud Blog |
How to do multivariate time series forecasting in BigQuery ML |
https://cloud.google.com/blog/products/data-analytics/how-to-do-multivariate-time-series-forecasting-in-bigquery-ml/
|
How to do multivariate time series forecasting in BigQuery MLCompanies across industries rely heavily on time series forecasting to project product demand forecast sales project online subscription cancellation and for many other use cases This makes time series forecasting one of the most popular models in BigQuery ML What is multivariate time series forecasting For example if you want to forecast ice cream sales it is helpful to forecast using the external covariant “weather along with the target metric “past sales Multivariate time series forecasting in BigQuery lets you create more accurate forecasting models without having to move data out of BigQuery When it comes to time series forecasting covariates or features besides the target time series are often used to provide better forecasting Up until now BigQuery ML has only supported univariate time series modeling using the ARIMA PLUS model documentation It is one of the most popular BigQuery ML models While ARIMA PLUS is widely used forecasting using only the target variable is sometimes not sufficient Some patterns inside the time series strongly depend on other features We see strong customer demand for multivariate time series forecasting support that allows you to forecast using covariate and features We recently announced the public preview of multivariate time series forecasting with external regressors We are introducing a new model type ARIMA PLUS XREG where the XREG refers to external regressors or side features You can use the SELECT statement to choose side features with the target time series This new model leverages the BigQuery ML linear regression model to include the side features and the BigQuery ML ARIMA PLUS model to model the linear regression residuals The ARIMA PLUS XREG model supports the following capabilities Automatic feature engineering for numerical categorical and array features All the model capabilities of the ARIMA PLUS model such as detecting seasonal trends holidays etc Headlight an AI powered ad agency is using a multivariate forecasting model to determine conversion volumes for down funnel metrics like subscriptions cancellations etc based on cohort age You can check out the customer video and demo here The following sections show some examples of the new ARIMA PLUS XREG model in BigQuery ML In this example we explore the bigquery public data epa historical air quality dataset which has daily air quality and weather information We use the model to forecast the PM based on its historical data and some covariates such as temperature and wind speed An example forecast Seattle s air quality with weather informationStep Create the datasetThe PM temperature and wind speed data are in separate tables To simplify the queries create a new table by joining those tables into a new table “bqml test seattle air quality daily with the following columns date the date of the observationPM the average PM value for each daywind speed the average wind speed for each daytemperature the highest temperature for each dayThe new table has daily data from to code block StructValue u code u CREATE TABLE bqml test seattle air quality daily r nAS r nWITH r n pm daily AS r n SELECT r n avg arithmetic mean AS pm date local AS date r n FROM r n bigquery public data epa historical air quality pm nonfrm daily summary r n WHERE r n city name Seattle r n AND parameter name Acceptable PM AQI amp Speciation Mass r n GROUP BY date local r n r n wind speed daily AS r n SELECT r n avg arithmetic mean AS wind speed date local AS date r n FROM r n bigquery public data epa historical air quality wind daily summary r n WHERE r n city name Seattle AND parameter name Wind Speed Resultant r n GROUP BY date local r n r n temperature daily AS r n SELECT r n avg first max value AS temperature date local AS date r n FROM r n bigquery public data epa historical air quality temperature daily summary r n WHERE r n city name Seattle AND parameter name Outdoor Temperature r n GROUP BY date local r n r nSELECT r n pm daily date AS date pm wind speed temperature r nFROM pm daily r nJOIN wind speed daily USING date r nJOIN temperature daily USING date u language u u caption lt wagtail wagtailcore rich text RichText object at xedcd gt Here is a preview of the data Step Create ModelThe “CREATE MODEL query of the new multivariate model ARIMA PLUS XREG is very similar to the current ARIMA PLUS model The major differences are the MODEL TYPE and inclusion of feature columns in the SELECT statement code block StructValue u code u CREATE OR REPLACE r n MODEL r n bqml test seattle pm xreg model r n OPTIONS r n MODEL TYPE ARIMA PLUS XREG r n time series timestamp col date r n time series data col pm r nAS r nSELECT r n date r n pm r n temperature r n wind speed r nFROM r n bqml test seattle air quality daily r nWHERE r n date r n BETWEEN DATE r n AND DATE u language u u caption lt wagtail wagtailcore rich text RichText object at xedcdd gt Step Forecast the future dataWith the created model you can use the ML FORECAST function to forecast the future data Compared to the ARIMA PLUS model you have to specify the future covariates as an input code block StructValue u code u SELECT r n r nFROM r n ML FORECAST r n MODEL r n bqml test seattle pm xreg model r n STRUCT AS horizon r n r n SELECT r n date r n temperature r n wind speed r n FROM r n bqml test seattle air quality daily r n WHERE r n date gt DATE r n u language u u caption lt wagtail wagtailcore rich text RichText object at xedcddd gt After running the above query you can see the forecasting results Step Evaluate the modelYou can use the ML EVALUATE function to evaluate the forecasting errors You can set perform aggregation to “TRUE to get the aggregated error metric or “FALSE to see the per timestamp errors code block StructValue u code u SELECT r n r nFROM r n ML EVALUATE r n MODEL bqml test seattle pm xreg model r n r n SELECT r n date r n pm r n temperature r n wind speed r n FROM r n bqml test seattle air quality daily r n WHERE r n date gt DATE r n r n STRUCT r n TRUE AS perform aggregation r n AS horizon u language u u caption lt wagtail wagtailcore rich text RichText object at xedcdd gt The evaluation result of ARIMA PLUS XREG is as follows As a comparison we also show the univariate forecasting ARIMA PLUS result in the following table Compared to ARIMA PLUS ARIMA PLUS XREG performs better on all measured metrics on this specific dataset and date range ConclusionIn the previous example we demonstrated how to create a multivariate time series forecasting model forecast future values using the model and evaluate the forecasted results The ML ARIMA EVALUATE and ML ARIMA COEFFICIENTS table value functions are also helpful for investigating your model Based on the feedback from users the model does the following to improve user productivity It shortens the time spent preprocessing data and lets users keep their data in BigQuery when doing machine learning It reduces overhead for the users who know SQL to do machine learning work in BigQuery For more information about the ARIMA PLUS XREG model please see thedocumentation here What s Next In this blogpost we described the BigQuery ML Multivariate Time Series Forecast model which is now available for public preview We also showed a code demo for a data scientist data engineer or data analyst to enable the multivariate time series forecast model The following features are coming soon Large scale multivariate time series i e training millions of models for millions of multivariate time series in a single CREATE MODEL statementMultivariate time series anomaly detectionThanks to Xi Cheng Honglin Zheng Jiashang Liu Amir Hormati Mingge Deng and Abhinav Khushraj from the BigQuery ML team Also thanks to Weijie Shen from the Google Resource Efficiency Data Science team A measure of air pollution from fine particulate matter |
2023-01-19 19:00:00 |
コメント
コメントを投稿