Skip to content

Commit

Permalink
chore: add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-docs-eng-opensource-bot committed Oct 12, 2024
1 parent 0f062c7 commit 13bb55e
Show file tree
Hide file tree
Showing 124 changed files with 2,399 additions and 2,909 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
<td>
`trace_id`

_cadena_
*cadena*
</td>

<td>
Expand All @@ -64,7 +64,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
<td>
`rating`

_cadena_ o _int_
*cadena* o *int*
</td>

<td>
Expand All @@ -76,7 +76,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
<td>
`category`

_cadena_
*cadena*
</td>

<td>
Expand All @@ -88,7 +88,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
<td>
`message`

_cadena_
*cadena*
</td>

<td>
Expand All @@ -100,7 +100,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
<td>
`metadata`

_dict_
*dict*
</td>

<td>
Expand All @@ -110,7 +110,7 @@ En muchos casos, el extremo de los mensajes de IA se graba en lugares diferentes
</tbody>
</table>

## Valores de retorno [#return-valuess]
## Valores de retorno [#return-values]

Ninguno.

Expand All @@ -129,4 +129,4 @@ Ejemplo de grabación de un evento de retroalimentación:
def post_feedback(request):
newrelic.agent.record_llm_feedback_event(trace_id=request.trace_id, rating=request.rating, metadata= {"my_key": "my_val"})
```
````
````
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: WithLlmCustomAttributes (API del agente de Python)
type: apiDoc
shortDescription: Agregar atributo personalizado al evento LLM
tags:
- Agents
- Python agent
- Python agent API
metaDescription: 'Python API: This API adds custom attributes to a Large Language Model (LLM) events generated in AI applications.'
freshnessValidatedDate: never
translationType: machine
---

## Sintaxis [#syntax]

```py
with newrelic.agent.WithLlmCustomAttributes(custom_attribute_map):
```

API de administrador de contexto que agrega un atributo especificado por el usuario al evento de modelo de lenguaje extenso (LLM) generado por llamadas de LLM en el código de la aplicación.

## Requisitos [#requirements]

Versión 10.1.0 del agente Python o superior.

## Descripción [#description]

Esta API de administrador de contexto agrega atributos personalizados especificados por el usuario a cada evento LLM generado dentro de su contexto en función de las llamadas realizadas a los LLM. El agente agregará automáticamente un prefijo `llm.` a cada nombre de clave de atributo personalizado especificado en el argumento del diccionario pasado. Esta API debe llamar dentro del contexto de una transacción activa.

Estos atributos personalizados se pueden ver en LLM evento y consultar en la New Relic UI. Para obtener más información sobre el monitoreo de IA, consulte nuestra [documentación de IA](https://docs.newrelic.com/docs/ai-monitoring/intro-to-ai-monitoring/).

## Parámetros [#parameters]

<table>
<thead>
<tr>
<th width="25%">
Parámetro
</th>

<th>
Descripción
</th>
</tr>
</thead>

<tbody>
<tr>
<td>
`custom_attribute_map`

*diccionario*
</td>

<td>
Requerido. Un diccionario no vacío donde cada par de valores principales indica el nombre del atributo personalizado y su respectivo valor.
</td>
</tr>
</tbody>
</table>

## Valores de retorno [#return-values]

Ninguno.

## Ejemplos [#examples]

### Agregue un atributo personalizado a una llamada de finalización de chat OpenAI

```py
import newrelic.agent

from openai import OpenAI

client = OpenAI()

with newrelic.agent.WithLlmCustomAttributes({"custom": "attr", "custom1": "attr1"}):
response = client.chat.completions.create(
messages=[{
"role": "user",
"content": "Say this is a test",
}],
model="gpt-4o-mini",
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Al migrar de nuestra integración tradicional de Azure al monitoreo de integraci

* Cuando habilita un monitoreo de integración de Azure, se creará una nueva entidad separada para todos sus recursos. La entidad creada por la integración Azure Polling se queda como está. Esto significa que debe actualizar el panel, las alertas y cualquier otra capacidad que haga referencia a esas entidades.
* Las entidades antiguas están disponibles durante 24 horas.
* Un nombre de métrica puede aparecer dos veces cuando la métrica tiene diferentes combinaciones de dimensiones. Puede evitar nombres de métricas duplicados [creando una consulta que filtre las agregaciones de sus datos](/docs/infrastructure/microsoft-azure-integrations/get-started/azure-integration-metrics/#metrics-with-many-dimension-combinations).

## Pasos de migración desde la integración anterior de Azure Polling [#migration-from-polling]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ newrelic_remote_write:
extra_write_relabel_configs:
# Enable the extra_write_relabel_configs below for backwards compatibility with legacy POMI labels.
# This helpful when migrating from POMI to ensure that Prometheus metrics will contain both labels (e.g. cluster_name and clusterName).
# For more migration info, please visit the [migration guide](/docs/infrastructure/prometheus-integrations/install-configure-prometheus-agent/migration-guide/).
- source_labels: [namespace]
action: replace
target_label: namespaceName
Expand Down Expand Up @@ -218,4 +217,4 @@ newrelic-prometheus-agent:
enabled: false
```

Siga los pasos explicados en este [documento](/docs/kubernetes-pixie/kubernetes-integration/installation/install-kubernetes-integration-using-helm/#upgrade) para actualizar el clúster de Kubernetes mediante Helm.
Siga los pasos explicados en este [documento](/docs/kubernetes-pixie/kubernetes-integration/installation/install-kubernetes-integration-using-helm/#upgrade) para actualizar el clúster de Kubernetes mediante Helm.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Para configurar el agente usando Helm, debe configurar su `values.yaml` de una d
<Collapser id="nri-bundle" title="Instalado usando nuestro paquete Helm">
```yaml
global:
licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_
cluster: _K8S_CLUSTER_NAME_
licenseKey: YOUR_NEW_RELIC_LICENSE_KEY
cluster: K8S_CLUSTER_NAME

newrelic-prometheus-agent:
enabled: true
Expand All @@ -37,8 +37,8 @@ Para configurar el agente usando Helm, debe configurar su `values.yaml` de una d
Esta opción sólo se recomienda si eres un usuario avanzado.

```yaml
licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_
cluster: _K8S_CLUSTER_NAME_
licenseKey: YOUR_NEW_RELIC_LICENSE_KEY
cluster: K8S_CLUSTER_NAME
config:
# YOUR CONFIGURATION GOES HERE. An example:
Expand Down Expand Up @@ -66,8 +66,8 @@ app_values: ["redis", "traefik", "calico", "nginx", "coredns", "kube-dns", "etcd

Además, puede suceder que una nueva versión de los filtros de integración haga que un objetivo que ya fue eliminado por un trabajo sea eliminado por segunda vez. Para recibir una notificación en caso de datos duplicados (y evitar por completo el scraping duplicado), puede crear una alerta basada en la siguiente consulta:

```
FROM Metric select uniqueCount(job) facet instance, cluster_name limit 10 since 2 minutes ago
```sql
FROM Metric SELECT uniqueCount(job) FACET instance, cluster_name LIMIT 10 SINCE 2 minutes ago
```

Si algún valor es diferente de 1, entonces tiene dos o más trabajos extrayendo la misma instancia en el mismo clúster.
Expand Down Expand Up @@ -99,19 +99,19 @@ El siguiente ejemplo solo extrae `Pods` y `Endpoints` con la anotación `newreli
```yaml
kubernetes:
jobs:
- job_name_prefix: example
integrations_filter:
enabled: false
target_discovery:
pod: true
endpoints: true
filter:
annotations:
# <string>: <regex>
newrelic.io/scrape: 'true'
label:
# <string>: <regex>
k8s.io/app: '(postgres|mysql)'
- job_name_prefix: example
integrations_filter:
enabled: false
target_discovery:
pod: true
endpoints: true
filter:
annotations:
# <string>: <regex>
newrelic.io/scrape: "true"
label:
# <string>: <regex>
k8s.io/app: "(postgres|mysql)"
```

<Callout variant="tip">
Expand Down Expand Up @@ -174,21 +174,21 @@ common:
scrape_interval: 30s
kubernetes:
jobs:
# this job will use the default scrape_interval defined in common.
- job_name_prefix: default-targets-with-30s-interval
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape: 'true'
- job_name_prefix: slow-targets-with-60s-interval
scrape_interval: 60s
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape_slow: 'true'
# this job will use the default scrape_interval defined in common.
- job_name_prefix: default-targets-with-30s-interval
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape: "true"
- job_name_prefix: slow-targets-with-60s-interval
scrape_interval: 60s
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape_slow: "true"
```

## Transformaciones métricas y de etiquetas [#metric-label-transformations]
Expand All @@ -203,21 +203,21 @@ Aquí hay un ejemplo de cómo usarlo en diferentes partes del archivo de configu

```yaml
static_targets:
- name: self-metrics
urls:
- 'http://static-service:8181'
extra_metric_relabel_config:
# Drop metrics with prefix 'go_' for this target.
- source_labels: [__name__]
regex: 'go_.+'
action: drop
- name: self-metrics
urls:
- "http://static-service:8181"
extra_metric_relabel_config:
# Drop metrics with prefix 'go_' for this target.
- source_labels: [__name__]
regex: "go_.+"
action: drop
newrelic_remote_write:
extra_write_relabel_configs:
# Drop all metrics with the specified name before sent to New Relic.
- source_labels: [__name__]
regex: 'metric_name'
action: drop
# Drop all metrics with the specified name before sent to New Relic.
- source_labels: [__name__]
regex: "metric_name"
action: drop
```

### Muestras de fragmentos de archivos YAML [#config-samples]
Expand Down Expand Up @@ -270,10 +270,10 @@ Agregue uno de estos ejemplos en el archivo de configuración YAML desde la secc
<Collapser id="collapser-source" title="Agregue las etiquetas 'new_label=newLabelValue' a los nombres métricos que comienzan con 'prefix_'">
```yaml
- source_labels: [__name__]
regex: 'prefix_.+'
target_label: new_label
action: replace
replacement: newLabelValue
regex: 'prefix_.+'
target_label: new_label
action: replace
replacement: newLabelValue
```
</Collapser>

Expand All @@ -282,7 +282,7 @@ Agregue uno de estos ejemplos en el archivo de configuración YAML desde la secc

```yaml
- regex: 'label_name'
action: labeldrop
action: labeldrop
```
</Collapser>
</CollapserGroup>
Expand All @@ -303,36 +303,37 @@ A continuación se muestran algunos ejemplos para tratar objetivos que necesitan
```yaml
kubernetes:
jobs:
- job_name_prefix: skip-verify-on-https-targets
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape: 'true'
- job_name_prefix: bearer-token
target_discovery:
pod: true
filter:
label:
k8s.io/app: my-app-with-token
authorization:
type: Bearer
credentials_file: '/etc/my-app/token'
- job_name_prefix: skip-verify-on-https-targets
target_discovery:
pod: true
filter:
annotations:
newrelic.io/scrape: "true"
- job_name_prefix: bearer-token
target_discovery:
pod: true
filter:
label:
k8s.io/app: my-app-with-token
authorization:
type: Bearer
credentials_file: "/etc/my-app/token"
static_targets:
jobs:
- job_name: mtls-target
scheme: https
targets:
- 'my-mtls-target:8181'
tls_config:
ca_file: '/etc/my-app/client-ca.crt'
cert_file: '/etc/my-app/client.crt'
key_file: '/etc/my-app/client.key'
- job_name: basic-auth-target
targets:
- 'my-basic-auth-static:8181'
basic_auth:
password_file: '/etc/my-app/pass.htpasswd'
- job_name: mtls-target
scheme: https
targets:
- "my-mtls-target:8181"
tls_config:
ca_file: "/etc/my-app/client-ca.crt"
cert_file: "/etc/my-app/client.crt"
key_file: "/etc/my-app/client.key"
- job_name: basic-auth-target
targets:
- "my-basic-auth-static:8181"
basic_auth:
password_file: "/etc/my-app/pass.htpasswd"
```
Loading

0 comments on commit 13bb55e

Please sign in to comment.