![Search icon](https://hackernoon.imgix.net/search-new.png?w=19&h=19)
Kala, tango tozalaki kolobela backend, tozalaki mbala mingi kolobela application moko ya munene na base de données moko, ya munene, mpe logging ezalaki suffisant pona suivi. Sikoyo, grâce na ba technologies lokola Kubernetes , ba microservices ekomi standard. Ba applications ezali ebele mpe ekabolami, mpe logging ya bonkoko ekoki lisusu te mpo na ko déboguer mpe ko diagnostiquer ba problèmes na ba applications na biso.
Solution moko ya malamu mingi pona kobongisa bolandi ezali OpenTelemetry — bokumbi bisaleli ya mikolo oyo oyo ekoki kosalelama pona débogage pe analyse ya performance ya ba systèmes distribués.
Lisolo oyo ezali pona ba professionnels ya IT oyo bazali koluka ko augmenter connaissance na bango na optimisation ya backend. Na nse, tokoyebisa na bozindo nini OpenTelemetry ezali, makanisi na yango ya ntina, mpe mikakatano oyo esalisaka mpo na kosilisa. Soki ozali na posa ya koyeba ndenge nini OpenTelemetry ekoki kobongola ndenge na yo ya kolandela mpe kosala débogage ya ba systèmes ya sima, kotombola bondimi mpe efficacité na bango — tanga lisusu.
Ba entreprises minene ya tech ekutanaki liboso na mokakatano ya bokati banzete mpe ya bolandi ya kokabolama na suka ya bambula 2000. Na 2010, Google ebimisaki mokanda moko, .
Na 2014, Kubernetes ebimaki, e simplifiaki mingi développement ya ba microservices na ba systèmes misusu oyo ekabolami na cloud. Yango esalaki ete ba entreprises mingi ekutana na ba problèmes na bokati banzete mpe traçage distribué na ba microservices. Pona ko standardiser traçage distribué, norme OpenTracing, oyo ezuami na CNCF, pe projet OpenCensus ya Google esalemaki.
Na 2019, ba projets ya OpenTracing na OpenCensus esakolaki bosangisi na kombo OpenTelemetry. Plateforme oyo esangisaka ba meilleures pratiques oyo e accumule na ba mbula ebele, e permettre intégration sans soudure ya tracing, logging, na metrics na système nionso, sans considération ya complexité na yango.
Lelo oyo, OpenTelemetry ezali kaka projet te; ezali norme ya industrie pona kosangisa pe kotinda ba données ya télémétrie. Esalemi mpe esungami na lisanga ya bato ya mayele mpe ba sociétés oyo ezali liboso na zando lokola Google mpe Microsoft. Projet ezali kokoba kokola, kozua makoki ya sika pona ko simplifier processus ya intégration pe ya usage.
OpenTelemetry ezali ensemble complète ya ba pratiques na ba outils oyo e définir ba signaux nini application ekoki ko produire pona ko interagir na monde ya libanda, pe ndenge nini ba signaux wana ekoki kosangisama pe ko visualiser pona ko suivre état ya ba applications pe système na mobimba na yango. Lolenge misato ya minene ya bilembo ezali tracing, logging , mpe metrics collection .
**Totala malamu eteni moko na moko: \
OpenTelemetry ekotisaka likanisi ya ba contextes ya fonctionnement. Contexte ezali libosoliboso na ba attributs lokola `trace_id`
(identifier mpo na opération ya lelo) mpe `span_id`
(identifier mpo na sous-request, na retriment moko na moko ya sous-request oyo ezali na `span_id`
unique ).
En plus, contexte ekoki kozala na ba informations statiques, lokola kombo ya node esika application e déployé to kombo ya environnement (prod/qa). Bitando oyo, eyebani lokola bisaleli na terminologie ya OpenTelemetry, ekangami na journal, métrique, to trace nionso mpo na boluki na pete. Ba contextes ekoki pe kozala na ba données dynamiques, lokola identifiant ya point final ya lelo ( `http_path: "GET /user/:id/info"`
), oyo ekoki kozala sélectivement attaché na ba groupes ya ba journals, ba metrics, to ba traces.
Ba contextes ya OpenTelemetry ekoki koleka kati ya ba applications ndenge na ndenge na kosalelaka ba protocoles ya propagation ya contexte. Ba protocoles oyo ezali na ba ensembles ya ba têtes oyo ebakisami na demande nionso ya HTTP to gRPC to ba têtes ya ba messages pona ba queue. Yango epesaka nzela na ba applications en aval ya ko reconstruire contexte ya opération à partir ya ba têtes oyo.
Tala mwa bandakisa ya bopanzani ya contexte:
B3-Propagation Oyo ezali ensemble ya ba têtes ( x-b3-*
) oyo esalemaki na ebandeli pona système ya traçage ya Zipkin. Ebongolamaki na OpenTracing mpe esalelamaki na bisaleli mpe bibliotɛkɛ mingi. B3-Propagation ememaka trace_id
/ span_id
mpe drapeau oyo ezali kolakisa soki échantillonnage esengeli.
W3C Trace Context Esalemi na groupe ya mosala ya W3C, norme oyo esangisaka ba approches ndenge na ndenge ya propagation ya contexte na norme moko pe ezali par défaut na OpenTelemetry. Ndakisa malamu ya kosalela ba normes oyo ezali kolandela exécution ya demande oyo ezali koleka na ba microservices oyo esalemi na ba technologies différentes sans ko compromiser précision ya suivi mpe ya débogage.
Tracing ezali processus ya enregistrement mpe na sima ko visualiser chronologie ya nzela ya demande na nzela ya ba microservices ebele.
Na visualisation, barre moko na moko babengaka yango "span" mpe ezali na "span_id" unique. Span ya misisa ebengami "trace" mpe ezali na "trace_id" , oyo esalaka lokola identifiant mpo na bosengi mobimba.
Lolenge oyo ya visualisation epesaka yo nzela ya:
trace_id
na span_id
pona kosalela na ba signaux misusu.
Atako emonani ete ezali pɛtɛɛ, kokata banzete ezali kaka moko ya bisaleli ya nguya mingi mpo na koyeba mikakatano. OpenTelemetry ematisaka bokati mikanda ya bonkoko na kobakisa sango ya contexte. Na bosikisiki, soki trace active ezali, ba attributs `trace_id` na `span_id` ebakisami automatiquement na ba journal, ko relier yango na chronologie ya trace. Lisusu, ba attributs ya journal ekoki kozala na ba informations statiques oyo ewutaka na contexte ya OpenTelemetry, lokola identifiant ya noeud, lokola pe ba informations dynamiques, lokola identifiant ya point final HTTP ya lelo (`http_path: "GET /user/:id"`).
Na kosalelaka `trace_id`, okoki koluka ba journals uta na ba microservices nionso oyo esangisi na bosengi ya lelo, nzoka nde `span_id` epesi yo nzela ya kokesenisa kati ya ba sous-requests. Ndakisa, na likambo ya komeka lisusu, ba journal oyo euti na ba tentatives ndenge na ndenge ekozala na ba `span_id`s ekeseni. Kosalela ba identifiants oyo epesaka nzela na analyse rapide ya comportement ya système mobimba en temps réel, kosala diagnostic ya problème noki mpe ko améliorer stabilité mpe fidélité.
Bosangisi ya ba metrics epesaka ba données quantitatives na performance ya système, lokola latence, taux ya erreur, usage ya ressource, pe ebele. Bolandi na tango ya solo ya ba metrics epesaka yo nzela ya koyanola noki na mbongwana ya performance, kopekisa ba pannes mpe kolemba ya makoki, mpe kosala ete bozali mpe bondimi ya application ezala mingi mpo na basaleli.
Intégration na ba systèmes ya stockage métrique na visualisation lokola Prometheus na Grafana ekomisaka facile ko visualiser ba données oyo, e simplifier significativement suivi.
Ba collecteurs métriques ya OpenTelemetry ezali compatible na ba normes ya Prometheus na OpenMetrics, ko permettre transition facile na ba solutions ya OpenTelemetry sans changement ya significatif. SDK ya OpenTelemetry epesaka nzela na ba exemples ya trace_id e exporter elongo na ba metrics, kosala que ezala possible ya ko corrélation ba metrics na ba exemples ya journal na ba traces.
Elongo, ba journal, ba metrics, mpe tracing esali vue complète ya état ya système:
Longola ba composantes misato ya moboko, OpenTelemetry esangisi makanisi ya Sampling, Baggage, mpe gestion ya contexte ya exploitation.
Na ba systèmes ya charge makasi, volume ya ba journals na ba traces ekomaka munene, esengaka ba ressources ya minene pona ba infrastructures pe kobomba ba données. Mpo na kosilisa likambo oyo, mibeko ya OpenTelemetry ezali na échantillonnage ya signal — makoki ya kotinda kaka eteni ya ba traces mpe ba journals. Ndakisa, okoki kobimisa bilembo ya sikisiki uta na pourcentage ya masengi, masengi oyo eumelaka, to masengi ya mabunga. Ndenge oyo epesi nzela na échantillonnage ekoki pona kotonga ba statistiques tango ya kobomba makoki ya motuya.
Kasi, soki système moko na moko e décider indépendamment ba demandes nini esengeli ko surveiller na détail, tosukaka na vue fragmentée ya demande moko na moko. Ba systèmes misusu ekoki ko exporter ba données détaillées alors que misusu ekoki kaka ko exporter en partie to ko exporter ata muke te.
Mpo na kosilisa mokakatano oyo, ba mécanismes ya propagation ya contexte ya OpenTelemetry etindi drapeau ya échantillonnage elongo na `trace_id`/`span_id`. Yango ezali kosala ete soki service ya liboso oyo ezwi bosengi ya mosaleli ezwi mokano ete esengeli kolandela bosengi na bozindo, ba systèmes mosusu nyonso ekolanda yango. Soki te, ba systèmes nionso esengeli e exporter en partie to te ba signaux pona kobatela ba ressources. Ndenge oyo babengaka yango "Head Sampling" — mokano oyo ezwami na ebandeli ya mosala ya bosengi, ezala na ndenge ya pwasa to na kotalela mwa bizaleli ya bokotisi.
D'ailleurs, OpenTelemetry esungaka "Tail Sampling," esika ba applications nionso e exporter toujours ba signaux nionso na détail, kasi tampon intermédiaire ezali. Sima ya kosangisa ba données nionso, tampon oyo ezuaka mokano soki ekobatela ba données mobimba to ekobomba kaka échantillon partiel. Méthode oyo epesi nzela na échantillon oyo ezali représentant mingi ya catégorie moko moko ya demande (succès/long/erreur) kasi esengaka configuration ya infrastructure ya kobakisa.
Mecanisme ya Baggage epesaka nzela na ba paires arbitraires ya valeur-clé e transmettre elongo na trace_id
/ span_id
, koleka automatiquement entre ba microservices nionso na tango ya traitement ya demande. Yango ezali na ntina mpo na kotinda ba sango ya kobakisa oyo esengeli na nzela mobimba ya bosengi —lokola sango ya mosaleli to ba paramètres ya esika ya tango ya kosala.
Ndakisa ya tête pona kotinda bagage selon norme W3C : tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE,userId=1c30032v5
Talá mwa bandakisa ya kosalela Bagage:
Koleka Basango ya Contexte ya mombongo lokola userId
, productId
, to deviceId
ekoki koleka na ba microservices nionso. Ba applications ekoki automatiquement ko enregistrer information oyo, ko permettre ba recherches ya journal na contexte ya usager pona demande originale.
Paramètres ya configuration spécifique Paramètres pona ba SDK to infrastructure.
Ba drapeaux ya routage Ba drapeaux oyo esalisaka ba balanceurs ya charge bazua ba décisions ya routage. Na tango ya komeka, ba demandes mosusu ekoki kozala na besoin ya ko router na ba backends ya mock. Lokola bagage etindamaka automatiquement na nzela ya ba services nionso, ezali na ntina te ya kosala ba protocoles ya kobakisa —bobele kotya mobeko moko na balanceur ya charge.
Simbá ete atako bopusi ya performance ya Baggage ezali moke, kosalela mingi ekoki komatisaka mingi charge ya réseau mpe ya service. Pona na bokebi ba données nini esengeli vraiment oleka na Baggage po o éviter ba problèmes ya performance.
Kosalela OpenTelemetry na niveau ya infrastructure esangisi kosangisa ba backends ya OpenTelemetry na architecture ya application pe ko configurer infrastructure pona agrégation ya ba données.
Processus ezali na ba étapes minei :
Bosangisi ya ba applications Na eteni ya yambo, ba SDK ya OpenTelemetry esangisi mbala moko na ba applications pona kosangisa ba metrics, ba journals, pe ba traces, ko assurer flux continue ya ba données oyo etali performance ya composante moko moko ya système.
Configuration ya ba exportateurs Ba données oyo esangisi ezo router depuis ba applications na nzela ya ba exportateurs na ba systèmes ya libanda pona ko traité lisusu, lokola ba systèmes ya enregistrement, suivi, traçage, to ya analyse, selon ba besoins na yo.
Bosangisi pe bobateli Etape oyo ekoki kozala na normalisation ya ba données, ko enrichir yango na ba informations ya kobakisa, pe kosangisa ba données oyo ewutaka na ba sources différentes pona kosala vue unifiée ya état ya système.
Visualisation ya ba données Na suka, ba données traitées elakisami lokola ba tableaux de bord na ba systèmes lokola Grafana (pour metrics et traces) to Kibana (pour les journals). Yango epesaka nzela na ba équipes kotala noki santé ya système, koyeba makambo mpe ba tendances, mpe kosala ba alertes oyo esalemi na ba signaux oyo esalemi.
Mpo na kosangana na application, esengeli o connecter OpenTelemetry SDK oyo ebongi mpo na monoko ya programmation oyo ezali kosalelama to osalela ba bibliothèques mpe ba cadres oyo esungaka directement OpenTelemetry. OpenTelemetry mbala mingi esalelaka ba interfaces oyo esalelamaka mingi uta na ba bibliothèques eyebani, kopesa nzela na ba remplacements ya drop-in. Ndakisa, bibliothèque ya Micromètre esalelamaka mingi pona bosangisi ba metrics na écosystème ya Java. OpenTelemetry SDK epesaka ba implémentations na yango ya ba interfaces ya Micromètre, ko permettre exportation métrique sans ko changer code ya application ya munene. Lisusu, OpenTelemetry epesaka ba mise en œuvre ya ba interfaces ya kala ya OpenTracing na OpenCensus, ko faciliter migration ya malamu na OpenTelemetry.
Na ba systèmes informatiques, OpenTelemetry ekoki kokoma fonction ya avenir ya ba backends ya kozala na confiance pe efficace. Outil oyo e simplifier débogage na suivi mpe efungolaka pe ba opportunités ya compréhension profonde ya performance ya application na optimisation na niveau ya sika. Sangisa lisanga ya OpenTelemetry mpo na kosalisa na kobongisa lobi esika wapi bokeli ya sima ezali pete mpe ya malamu!